strange inability to require config/boot after upgrading to ruby 1.9.2

前端 未结 7 1482
孤独总比滥情好
孤独总比滥情好 2020-12-05 04:18

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:



        
相关标签:
7条回答
  • 2020-12-05 04:48

    The $: << File.dirname(__File__) + '..' won't work since you'd get a dir of

    'script..'

    Try

    $: << File.join(File.dirname(__FILE__),'..')
    
    0 讨论(0)
  • 2020-12-05 04:48

    Please check your root path before start padrino. like if your application in "C:\XXXXXXX\YYYYYYY\ZZZ-padrino" here and you are in "C:\XXXXXXX\YYYYYYY\" in command prompt then this error will occur. then you should in "C:\XXXXXXX\YYYYYYY\ZZZ-padrino".

    0 讨论(0)
  • 2020-12-05 04:59

    You might try to add the path source /usr/share/ruby-rvm/scripts/rvm

    0 讨论(0)
  • 2020-12-05 05:08

    Much simpler, does not require modification of all scripts:

    Instead of:

    script/server 
    

    call:

    ./script/server
    
    0 讨论(0)
  • 2020-12-05 05:08

    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__) + '..'
    
    0 讨论(0)
  • Replacing line 2 of script/server with

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

    works for me (taken from Rails 3)

    0 讨论(0)
提交回复
热议问题