升级1.9.2的时候出现的问题

    技术2025-07-26  12

     

    3 down vote favorite

    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:

     

    down votefavorite 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>'

    Replacing line 2 of script/server with

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

     

    works for me (taken from Rails 3)

     

     

    #

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

    add that in top of your script/server file :

    $: << File.dirname(__FILE__)

    Or in your case

    $: << File.dirname(__FILE__) + '..' server文件这样写: #!/usr/bin/env ruby require File.expand_path('../../config/boot', __FILE__) require 'commands/server'
    最新回复(0)