我正在尝试启动一个rails服务器,但我不断收到一条冗长而神秘的错误消息,说我有一个不兼容的nokogiri 1.6.8库版本。我已经查看了有关libxml2,libxslt和libiconv的其他类似解决方案,这些解决方案未与nokogiri链接,并且我已经尝试了人们建议的方法来解决此问题,但是我仍然收到以下消息:
Sams-MBP:toy-app name$ rails server
/Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `require': incompatible library version - /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri/nokogiri.bundle (fatal)
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `rescue in <top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:28:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/loofah-2.0.3/lib/loofah.rb:3:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/loofah-2.0.3/lib/loofah.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/sanitize_helper.rb:2:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/sanitize_helper.rb:2:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:32:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:18:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_helper.rb:4:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:50:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:7:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:7:in `<module:Context>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:6:in `<module:Rails>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:5:in `<module:Sprockets>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/railtie.rb:7:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/railtie.rb:7:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:14:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:14:in `block in <top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:12:in `each'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:12:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/config/application.rb:3:in `require'
from /Users/name/RubyWorkspace/toy-app/config/application.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
删除应用程序根目录中的Gemfile.lock
。然后,删除Gemfile
中编写的版本,只需在那里显示宝石的名称即可。然后,再次做bundle install
.也许这会有所帮助。