Strange inability to require config / boot after upgrade to ruby ​​1.9.2

I upgraded my ruby ​​to 1.9.2, and now when I try to run the Rails 2.3.5 application using 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 config / boot.rb file exists in the right place.

+38
ruby ruby-on-rails
05 Oct 2018-10-10
source share
7 answers

Replacing line 2 script / server

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

works for me (taken from Rails 3)

+51
Oct 05 '10 at 18:18
source share

Much simpler, does not require modification of all scripts:

Instead:

 script/server 

call:

 ./script/server 
+82
May 18 '11 at 16:00
source share

because ruby ​​1.9.2 does not add the current directory to LOAD_PATH.

Add this to the top of your script / server file:

 $: << File.dirname(__FILE__) 

Or in your case:

 $: << File.dirname(__FILE__) + '..' 
+13
Oct 05 2018-10-10
source share

I met the same problem as described. Ubuntu 10.04 x64, Eclipse Helio, AptanaStudion2 with RadRail, Ruby 1.9.2, Rails 2.3.5 this does not work for me:

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

It works for me

 require File.expand_path(__FILE__)+ '/../../config/boot' 
+1
Nov 04 '10 at 14:23
source share

$: << File.dirname(__File__) + '..' will not work, since you will get a directory

script ..

Try

 $: << File.join(File.dirname(__FILE__),'..') 
0
Oct 14 '10 at 9:29
source share

You can try adding the path source / usr / share / ruby-rvm / scripts / rvm

0
May 12 '12 at 9:27
source share

Please check your root path before padrino starts. for example, if your application is in "C: \ XXXXXXX \ YYYYYYY \ ZZZ-padrino" here, and you are in "C: \ XXXXXXX \ YYYYYYY \" on the command line, then this error will occur. then you should in "C: \ XXXXXXX \ YYYYYYY \ ZZZ-padrino".

0
Mar 26 '15 at 11:52
source share



All Articles