Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails app fails to start: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- script/../config/boot (LoadError) [duplicate]

I upgraded my ruby to 1.9.2 and now when I try to start up a Rails 2.3.5 app with script/server I get this error:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- script/../config/boot (LoadError)
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from script/server:2:in `<main>'

But script/server:2 definitely looks correct, and the file config/boot.rb exists in the right place.

like image 359
dan Avatar asked Oct 05 '10 16:10

dan


3 Answers

Much simpler, does not require modification of all scripts:

Instead of:

script/server 

call:

./script/server
like image 72
UncleGene Avatar answered Nov 04 '22 06:11

UncleGene


Replacing line 2 of script/server with

require File.expand_path('../../config/boot', __FILE__)

works for me (taken from Rails 3)

like image 28
Ian Fleeton Avatar answered Nov 04 '22 04:11

Ian Fleeton


it's because ruby 1.9.2 doesn't add the current directory in the LOAD_PATH.

Add this that in top of your script/server file:

$: << File.dirname(__FILE__)

Or in your case:

$: << File.dirname(__FILE__) + '..'
like image 13
shingara Avatar answered Nov 04 '22 06:11

shingara