LoadError:不兼容的库版本 - /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/nokogiri-1.8.2/lib/nokogiri/nokogiri.so

时间:2018-04-30 12:10:37

标签: ruby-on-rails ruby ubuntu-16.04 nokogiri

尝试使用生产模式运行rake资产预编译,如下所示。

rake assets:precompile

它适用于ubuntu 14.04(32位)和16.06(32位)。但在aws ec2中获得16.04(64位)的加载错误。

请帮我解决这个问题。

提前致谢。

这是我的完整堆栈跟踪

  耙子流产了! LoadError:不兼容的库版本 -   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/nokogiri-1.8.2/lib/nokogiri/nokogiri.so   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/nokogiri-1.8.2/lib/nokogiri.rb:32:in   rescue in <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/nokogiri-1.8.2/lib/nokogiri.rb:28:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/loofah-2.2.2/lib/loofah.rb:3:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/rails-html-sanitizer-1.0.4/lib/rails-html-sanitizer.rb:2:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers/sanitize_helper.rb:2:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:58:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:4:in   <module:ActionView>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:3:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/base.rb:5:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity/utility/view_helpers.rb:25:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity/utility/view_helpers.rb:2:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity.rb:68:in &#39;   /home/ubuntu/learnmusicco/config/application.rb:7:in <top (required)>' /home/ubuntu/learnmusicco/Rakefile:4:in&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/rake-12.3.1/exe/rake:27:in   `&#39;

     

引起:LoadError:无法加载此类文件 - nokogiri / 2.3 / nokogiri   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/nokogiri-1.8.2/lib/nokogiri.rb:30:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/loofah-2.2.2/lib/loofah.rb:3:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/rails-html-sanitizer-1.0.4/lib/rails-html-sanitizer.rb:2:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers/sanitize_helper.rb:2:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:58:in   <module:Helpers>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:4:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/helpers.rb:3:in   <top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   block in require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/actionview-5.0.1/lib/action_view/base.rb:5:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity/utility/view_helpers.rb:25:in   <module:PublicActivity>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity/utility/view_helpers.rb:2:in &#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in   require' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 阻止了要求&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in   load_dependency' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in 需要&#39;   /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/public_activity-1.5.0/lib/public_activity.rb:68:in   <top (required)>' /home/ubuntu/learnmusicco/config/application.rb:7:in&#39; / home / ubuntu / learnmusicco / Rakefile:4:<top (required)>' /home/ubuntu/.rvm/gems/ruby-2.3.1@lm5/gems/rake-12.3.1/exe/rake:27:in &#39;

1 个答案:

答案 0 :(得分:2)

您可以尝试运行gem pristine --all以在当前环境中自动卸载并重新安装所有已安装的gem。这可能会解决你的问题。

如果这不起作用,请尝试运行rm -rf `rvm gemdir`/bundler/gems强制删除所有宝石,然后尝试另一个bundle install