【发布时间】:2018-04-26 18:30:03
【问题描述】:
我正在尝试使用 capistrano 部署 Rails 应用程序,但是在服务器 ubuntu 16.04 中进行捆绑安装时,我遇到了 nokogiri gem 的一些问题
回溯如下:
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as root@104.236.11.204: bundle exit status: 5
bundle stdout: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/var/www/denunciabarranquillafinal/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20171113-30499-1nk84ws.rb
extconf.rb --use-system-libraries
Cannot allocate memory - /usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r
./siteconf20171113-30499-1nk84ws.rb extconf.rb --use-system-libraries 2>&1
Gem files will remain installed in
/var/www/denunciabarranquillafinal/shared/bundle/ruby/2.3.0/gems/nokogiri-1.8.1
for inspection.
Results logged to
/var/www/denunciabarranquillafinal/shared/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.1/gem_make.out
An error occurred while installing nokogiri (1.8.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.1'` succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.4, which depends on
actionmailer was resolved to 4.2.4, which depends on
actionpack was resolved to 4.2.4, which depends on
actionview was resolved to 4.2.4, which depends on
rails-dom-testing was resolved to 1.0.8, which depends on
nokogiri
bundle stderr: Nothing written
我运行了命令
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
在我的服务器中,如果我运行“gem install nokogiri”,gem 会正常安装。
希望有人能帮我解决这个错误。
【问题讨论】:
-
您不是只是通过安装所需的软件包来解决问题吗?
-
当它说“确保
gem install nokogiri -v '1.8.1'在捆绑之前成功。”,你应该试试。它会显示更具体的错误。 -
我修复了在我的服务器中运行
gem install bundler。 :)
标签: ruby-on-rails ruby ubuntu