SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: script/console LoadError
-
Jun 5, 2006, 02:05 #1
script/console LoadError
Hello,
When I enter the command "ruby script/console", instead of an irb
session beginning, I get the following error:
Code:c:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in 'require__': No such file to load -- ./script/../config/../config/environment (LoadError)
I'm a little new to Rails, but it appears to me that the path to the
required file is incorrect. The 'environment.rb' file is inside the
config folder, which is a sibling to the script folder, while the error
states that rails is looking for a config folder that is two levels up
from the script folder.
Since Rails runs on a 'convention not configuration' methodology, it isn't clear where I can make a change to fix this. It seems like Rails should be looking in './script/../config/environment' by default instead. Any ideas?
For reference, I'm running Rails 1.1.2 w/ Ruby 1.8.2 on an win32 machine
(for development).
Thanks,
Aaron
-
Jun 5, 2006, 03:15 #2
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try "rake freeze_edge", it helps sometimes to have the latest version.
Isn't this: ./script/../config/../config/environment the same as this: ./config/environment ?
-
Jun 5, 2006, 15:56 #3
From what I gather, "rake freeze_edge" would put me on the latest bleeding edge version instead of the latest stable version. Since I'm guessing that the console works well for others on the version I am, I'd like to try to solve this another way first.
Re: the path, there is a difference - the former starts in the script directory, moves up a directory and over to the config directory, then up a directory again and over to another config directory; while the latter points to the config directory inside the starting directory (which actually does reference the correct location).
The latter would work, but this is not a path I should have to enter. Rails is supposed to know where to look to start the console without me having to tell it where the config/environment file is - and this it does not appear to be doing.
Thanks,
Aaron
-
Jun 6, 2006, 08:22 #4
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
1. ./script/../config/../config/environment - ./ ("root" directory)
2. ./script/../config/../config/environment - ./script
3. ./script/../config/../config/environment - ./ (again)
4. ./script/../config/../config/environment - ./config
5../script/../config/../config/environment - ./
6. ./script/../config/../config/environment - ./config
7. ./script/../config/../config/environment - ./config/environment
Or am I wrong?
Maybe the problem is that you need environment.rb, and not just environment...I don't know if require automatically looks for environment.rb too?
Bookmarks