gpt4 book ai didi

ruby-on-rails - nokogiri gem - 错误 : Failed to build gem native extension.

转载 作者:行者123 更新时间:2023-12-04 18:45:17 26 4
gpt4 key购买 nike

我正在尝试使用 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 会正常安装。

我希望有人可以帮助我修复错误。

最佳答案

尝试这个 :

$ sudo apt-get update 
$ sudo apt-get install libxml2-dev libxslt-dev
$ sudo gem install nokogiri

关于ruby-on-rails - nokogiri gem - 错误 : Failed to build gem native extension.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47275097/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com