1

尝试运行时rails serverrails 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.rbrequire 'psych.so'. 我使用 ruby​​ 1.9.3,rails 3.2.14,psych 版本 2.0.5 安装在Gemfile.lock.

4

1 回答 1

0

我使用红宝石 1.9.3

你确定?

/path/to/project/vendor/bundle/ruby/1.9.1/gems/psych-2.0.5/lib/psych.rb

可能想确保您的环境是您所期望的。这是一个新问题吗?自从它过去工作以来发生了什么变化?我们几乎没有信息可以泄露。

于 2014-04-23T18:12:28.937 回答