Questions tagged [load-path]

63 questions
0
votes
1 answer

How to use I18n in a Rails' helper via a frozen class string

My Helper.. module WatableHelper # binding.pry ANALYTICS_MEMBERS_FORMAT_COLS = { email: { index: 1, type: 'string', friendly: I18n.t('system_roles.email'), unique: true }, name: { index: …
Trip
  • 26,756
  • 46
  • 158
  • 277
0
votes
1 answer

JRuby loadpath messed up

I am embedding JRuby on a JAR file and it's being used by a EAR file that I am deploying to WebSphere. When I call the class from my workspace, it works fine, however when I call it inside WebSphere, here's what I get: [3/31/11 11:21:15:984 BRT]…
kolrie
  • 12,562
  • 14
  • 64
  • 98
0
votes
1 answer

In Rails, I thought once the "Foo.all" is executed, then "models/foo.rb" is loaded?

In Rails, if I create a scaffold foo, and do rake db:migrate, then now app/models/foo.rb is created. So if I go to script/console (or rails console for Rails 3) and type $".grep /foo/i it is empty. $" is the loaded files. So foo.rb is not…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
1 answer

Why does ruby's '$:' or '$LOAD_PATH' change when I run it with sudo?

I am trying to run a ruby script as root. When I try to require a gem, ruby says it can't be found. This is because of $: $ ruby -e "puts…
Adrian
  • 14,931
  • 9
  • 45
  • 70
0
votes
1 answer

Rails: load_paths for directory and all subdirectories

In environment.rb I can add the line config.load_paths += %W( #{RAILS_ROOT}/app/models/foos ) where 'foos' is a folder. This loads all files inside the foos folder. However it doesn't load any of its subdirectories. If I knew the names of all the…
user94154
  • 16,176
  • 20
  • 77
  • 116
0
votes
2 answers

emacs cannot load file highlight-current-line file-error

Emacs version : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN Copied the code for highlight-current-line from here. Created a text-file in .emacs.d, pasted the entire text on page in the text-file and saved it as…
Flame of udun
  • 2,136
  • 7
  • 35
  • 79
0
votes
1 answer

Padrino not reloading custom load paths on changes

I added a custom directory to my Padrino application (0.12.4). I added it to the load paths and everything loaded fine. The issue is that Padrino is not reloading changes to the files in my custom path. boot.rb Padrino.before_load do …
Moemars
  • 4,692
  • 3
  • 27
  • 30
0
votes
1 answer

Bundler.setup messes with the load path

My library uses a Gem that loads libraries dynamically. For example, it loads 'sqlite3' if I choose an sqlite adapter. The problem is, if I write in my library require 'bundler' Bundler.setup it stops seeing the gems installed with rubygems and…
orion3
  • 9,797
  • 14
  • 67
  • 93
0
votes
1 answer

Loading a Ruby file in Windows 7. How do I do this? Loadpath issue?

I can't seem to load files. I am using Ruby 2.0.0 x64 and the built in command prompt with Ruby. I have 2 problems. 1) If I use Powershell or the cmd.exe, I can't access Ruby if I type in irb. Any idea how to connect the two. 2) So instead I use…
Jwan622
  • 11,015
  • 21
  • 88
  • 181
0
votes
4 answers

Use Ruby Class In A Different Directory

I have written a few ruby classes. However, when trying to access one from another directory I am getting the following error: uninitialized constant Main::AppVersion This is what the directory structure looks like: home --> a -->…
dev
  • 1,477
  • 5
  • 18
  • 43
0
votes
2 answers

Cannot open load file | Emacs doesn't see my .el files even if they exist on MAC OS X?

I recently started using MAC OS X Mavericks and I installed Emacs Version 24.3 (9.0) for MAC. Previously I used Emacs 23 on my Ubuntu laptop and everything worked great. I was trying to reset my .emacs init file on the MAC OS X (using the one I…
tonix
  • 6,671
  • 13
  • 75
  • 136
0
votes
1 answer

Why does my rails project not have the ruby standard lib in $LOAD_PATH on OSX?

I need to do a: require 'generator' Inside of a rails project, but it is not working for me on OSX, because the ruby standard library (which is located in my /usr/lib/ruby/1.8) is not in my $LOAD_PATH once rails boots. If I just run irb outside of…
Brad The App Guy
  • 16,255
  • 2
  • 41
  • 60
0
votes
1 answer

change default load path for devise views and controller

This is my gem file gem 'devise', '1.5.2' and this is my routes.rb devise_for :users This is what i learnt: Initially the controller,views were loading from vender/gems/1.91/ruby/devise 1.5.2 so what i did i added modified the app structure to…
Milind
  • 4,535
  • 2
  • 26
  • 58
0
votes
2 answers

LoadError occurs when directly running Ruby source code in existing projects

I'm new to Ruby/JRuby and has been disturbed by the error "LoadError: no such file to load" for many weeks, when I try to directly run the Ruby source code of certain projects. I downloaded the source code of many Ruby projects from GitHub. Yes only…
Erencie
  • 391
  • 2
  • 3
  • 12
0
votes
1 answer

emacs: load-path and require (cannot open load file)

I've got "Cannot open load file" error at (require 'org-mime) while load-path variable seems to be all right: load-path is a variable defined in `C source code'. Its value is ("/home/alexey/.emacs.d/elpa/bbdb-20130526.1945"…
Alexey Orlov
  • 2,412
  • 3
  • 27
  • 46