load-path Questions

9

Solved

I have seen two commonly used techniques for adding the directory of the file currently being executed to the $LOAD_PATH (or $:). I see the advantages of doing this in case you're not working with ...
Caribou asked 7/5, 2009 at 21:26

5

Solved

I currently have the following 4 files in my config/locales of my root application: -en.yml -de.yml -simple_form.en.yml -simple_form.de.yml In my application.rb which resides in a spec/dummy fol...

5

Solved

Been playing with Ruby on Rails for awhile and decided to take a look through the actual source. Grabbed the repo from GitHub and started looking around. Came across some code that I am not sure wh...
Syncretism asked 13/12, 2009 at 15:53

2

Solved

How can I deploy a simple ruby script via homebrew? Here's what I tried Wrote formula in a GitHub repo named homebrew-foo # file https://github.com/foo/homebrew-foo/blob/master/foo.rb class Foo ...
Shaw asked 16/7, 2017 at 16:45

1

Problem: I'm using gulp-sass and would like to define a load_path so that I don't have to have really long @import rules voor bower dependencies e.g. @import "normalize" instead of @import ".....
Overland asked 28/8, 2015 at 7:1

3

Solved

Whenever I see some installation instruction for an emacs package it always suggests to use add-to-list 'load-path it never works for me. For some reason and I have to use load-file. For example, t...
Countryfied asked 2/8, 2011 at 17:19

7

Solved

The latest changesets to Ruby 1.9.2 no longer make the current directory . part of your LOAD_PATH. I have a non-trivial number of Rakefiles that assume that . is part of the LOAD_PATH, so this brok...
Caldwell asked 24/5, 2010 at 21:12

2

Solved

I have two classes: 1.Sale is a subclass of ActiveRecord; its job is to persist sales data to the database. class Sale < ActiveRecord::Base def self.total_for_duration(start_date, end_date) ...
Froward asked 23/10, 2012 at 12:33

0

I was upgrading to Rails 3.2.6 (ruby 1.9.3-p194) and installing RVM on Debian and using Apache2 server (2.2.19). I used these very nice instructions: http://dalibornasevic.com/posts/21-rvm-and-pass...
Rookie asked 10/7, 2012 at 13:3

2

Solved

Assuming I compile my own fresh Ruby (MRI 1.9.3), what is the default LOAD_PATH, and how is that computed?
Detriment asked 31/5, 2012 at 16:52

2

Solved

I understand that to add a path to $LOAD_PATH just do $LOAD_PATH.unshift(path) But I have to add this line to every program I wrote. Is there anyway to add it to the system level? I tried to se...
Mousterian asked 12/4, 2012 at 3:48

3

Solved

Usually be seen in .gemspec file. eg. i18n.gemspec. $: << File.expand_path('../lib', __FILE__)
Weanling asked 21/10, 2011 at 7:43

3

Solved

I want to know more about $: but I don't how is called. :015 > $: => ["/Users/Nerian/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1", "/Users/Nerian/.rvm/rubies/ruby-1.9.3-rc1/lib/rub...
Drolet asked 3/10, 2011 at 12:1

4

Note that I am not using Rails. I have a directory structure like: foo/ bar/ base_classes/ base_classes.rb base_classes.rb: Dir.glob(File.expand_path(File.join("base_classes/config/constants",...
Sweetening asked 19/7, 2011 at 20:9

2

I pack some ruby code into a gem. I want to refer the code in the gem in some other code. So in the Gemfile I specify the gem's name, version, and local path. Like: gem 'gemname','0.x', :path =&gt...
Photomechanical asked 22/6, 2011 at 18:37

2

Solved

I want to write a gem that adds a app/services directory to a Rails application. Since I want to add it from within the Gem i came up with this solution: class Railtie < ::Rails::Railtie conf...
Scent asked 8/6, 2011 at 13:19

1

Solved

I've been trying to get a ruby file to require another ruby file and I feel like I'm going crazy. My setup is as follows Two files in '/raid1/ruby-code/benchmark/' CommandRunner Benchmarker Be...
Lumbard asked 28/10, 2010 at 0:28
1

© 2022 - 2024 — McMap. All rights reserved.