Nokogiri是针对LibXML构建的 - Rails

时间:2015-01-12 08:25:40

标签: ruby-on-rails ruby rvm

WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.0
    /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse': (<unknown>): mapping values are not allowed in this context at line 14 column 10 (Psych::SyntaxError)

我遇到了这个问题。当我运行Rails s或Rails C时,会出现这种情况。

我认为这与全球宝石有关。我在这个名为drugstore

的项目中使用了gemset
eldiablo:drug-store olleh$ rails c
/Users/olleh/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.7.11/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/olleh/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.7.11/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local in PATH, mode 040777
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.0
/Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse': (<unknown>): mapping values are not allowed in this context at line 14 column 10 (Psych::SyntaxError)
    from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse_stream'
    from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:317:in `parse'
    from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:244:in `load'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/application/configuration.rb:115:in `database_configuration'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activerecord-3.2.14/lib/active_record/railtie.rb:84:in `block (2 levels) in <class:Railtie>'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:25:in `each'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activerecord-3.2.14/lib/active_record/railtie.rb:80:in `block in <class:Railtie>'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /private/var/www/drug-store/config/environment.rb:5:in `<top (required)>'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environment!'
    from /Users/olleh/.rvm/gems/ruby-2.1.0@drugstore/gems/railties-3.2.14/lib/rails/commands.rb:40:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

1 个答案:

答案 0 :(得分:-2)

问题实际上是我的Db yml。

我的生产配置存在语法错误,因此出错。