简体   繁体   中英

Upgraded Rails project from 2.3.5 to 3.1 and am getting a: no such file to load — rails/init.rb when I run rails s

The following is what is spit out of the log when I run the rails server...

Roy-Sherrills-MacBook-Pro:emeraldcg tjs$ rails s
=> Booting WEBrick
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require': no such file to load -- rails/init.rb (LoadError)
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/tjs/Sites/emeraldcg/vendor/plugins/jrails/init.rb:1:in `block in <class:Plugin>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/plugin.rb:81:in `eval'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/plugin.rb:81:in `block in <class:Plugin>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/tjs/Sites/emeraldcg/config/environment.rb:5:in `<top (required)>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/tjs/Sites/emeraldcg/config.ru:4:in `block in <main>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/builder.rb:51:in `instance_eval'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/builder.rb:51:in `initialize'
from /Users/tjs/Sites/emeraldcg/config.ru:1:in `new'
from /Users/tjs/Sites/emeraldcg/config.ru:1:in `<main>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/builder.rb:40:in `eval'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/builder.rb:40:in `parse_file'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/server.rb:200:in `app'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/server.rb:301:in `wrapped_app'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.3/lib/rack/server.rb:252:in `start'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from /Users/tjs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Roy-Sherrills-MacBook-Pro:emeraldcg tjs$ 

any ideas?

I had a similar issue with a fresh install of Rails 3.1.1. I found a solution that worked for me on rails forum by barbared . See that entry for more details.

    rvm pkg install openssl
    rvm remove 1.9.2
    rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM