简体   繁体   中英

Capistrano deploy rails fails on nokogiri

I get the following error when deploying to Ubuntu using:

ruby '2.3.0'
gem 'rails', '~> 4.2', '>= 4.2.5.1'
gem 'rake', '~> 11.3'
gem 'capistrano',  '~> 3.9'

This is my server log:

00:29 deploy:assets:precompile
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 rake aborted!
01 LoadError: libruby.so.2.3: cannot open shared object file: No such file or directory - /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri/nokogiri.so
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `rescue in <top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:28:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `load'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
01 LoadError: cannot load such file -- nokogiri/2.3/nokogiri
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:30:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:30:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-xml-0.1.3/lib/fog/xml.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `require'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/fog-aws-1.4.1/lib/fog/aws.rb:2:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/config/application.rb:3:in `<top (required)>'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `require'
01 /home/myapp/myappWeb/releases/20171121132549/Rakefile:4:in `<top (required)>'
01 /home/myapp/myappWeb/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `load'
01 /home/myapp/.rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
01 (See full trace by running task with --trace)

What do you get if you try to run gem install nokogiri from your app directory on your server? You might be missing some librairies on your server. See http://www.nokogiri.org/tutorials/installing_nokogiri.html

I reinstalled the entire ubuntu system on the server. Then reinstalled ruby and bundler. Everything worked after this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM