尝试运行rails server
或rails console
时出现以下错误:
$ bundle exec rails server
/path/to/project/vendor/bundle/ruby/1.9.1/gems/psych-2.0.5/lib/psych.rb:1:in `require': SyntaxError is already defined (NameError)
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/psych-2.0.5/lib/psych.rb:1:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/ordered_hash.rb:2:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/ordered_hash.rb:2:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/ordered_options.rb:1:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/ordered_options.rb:1:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/configuration.rb:2:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/configuration.rb:2:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/railtie.rb:2:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/railtie.rb:2:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/engine.rb:1:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/engine.rb:1:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/plugin.rb:1:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/plugin.rb:1:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:3:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:3:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails.rb:10:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails.rb:10:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/all.rb:1:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/all.rb:1:in `<top (required)>'
from /path/to/project/config/application.rb:3:in `require'
from /path/to/project/config/application.rb:3:in `<top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in <top (required)>'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
from /path/to/project/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
/path/to/project/vendor/bundle/ruby/1.9.1/gems/psych-2.0.5/lib/psych.rb
中的第一行是require 'psych.so'
。我使用ruby 1.9.3,rails 3.2.14,精神版2.0.5在Gemfile.lock
中设置。
答案 0 :(得分:0)
我使用ruby 1.9.3
你确定吗?
/path/to/project/vendor/bundle/ruby/1.9.1/gems/psych-2.0.5/lib/psych.rb
可能希望确保您的环境符合预期。这是一个新问题吗?自从以前工作以来发生了什么变化?我们几乎没有任何信息可以解决。