gpt4 book ai didi

ruby-on-rails - 使用 Gemfile 中的 'gem unicorn' 将 Rails 应用程序部署到 Ubuntu 时出错

转载 作者:太空宇宙 更新时间:2023-11-03 17:00:54 25 4
gpt4 key购买 nike

我正在将 Rails 3.2.8 应用程序部署到 Ubuntu。服务器已经使用 Unicorn 和 Nginx 运行应用程序。unicorn -v 返回 unicorn v4.4.0

Adn rvm gem 列表显示: unicorn (4.4.0)

然而,当我手动运行 'gem install unicorn '4.4.0' 时,它失败并显示以下内容。有什么想法吗?

Installing unicorn (4.4.0)
** [out :: mydomain.net] with native extensions
** [out :: mydomain.net]
** [out :: mydomain.net] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
** [out :: mydomain.net]
** [out :: mydomain.net] /home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
** [out :: mydomain.net] checking for SIZEOF_OFF_T in ruby.h... *** extconf.rb failed ***
** [out :: mydomain.net] Could not create Makefile due to some reason, probably lack of
** [out :: mydomain.net] necessary libraries and/or headers. Check the mkmf.log file for more
** [out :: mydomain.net] details. You may need configuration options.
** [out :: mydomain.net]
** [out :: mydomain.net] Provided configuration options:
** [out :: mydomain.net] --with-opt-dir
** [out :: mydomain.net] --with-opt-include
** [out :: mydomain.net] --without-opt-include=${opt-dir}/include
** [out :: mydomain.net] --with-opt-lib
** [out :: mydomain.net] --without-opt-lib=${opt-dir}/lib
** [out :: mydomain.net] --with-make-prog
** [out :: mydomain.net] --without-make-prog
** [out :: mydomain.net] --srcdir=.
** [out :: mydomain.net] --curdir
** [out :: mydomain.net] --ruby=/home/eg/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
** [out :: mydomain.net] /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
** [out :: mydomain.net] You have to install development tools first.
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:686:in `macro_defined?'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:822:in `block in have_macro'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
** [out :: mydomain.net]
** [out :: mydomain.net] from /home/eg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:821:in `have_macro'
** [out :: mydomain.net] from extconf.rb:4:in `<main>'
** [out :: mydomain.net]
** [out :: mydomain.net]
** [out :: mydomain.net] Gem files will remain installed in /rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0 for inspection.
** [out :: mydomain.net] Results logged to /rails_apps/eg/production/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/ext/unicorn_http/gem_make.out
** [out :: mydomain.net]
** [out :: mydomain.net] An error occurred while installing unicorn (4.4.0), and Bundler cannot continue.
** [out :: mydomain.net] Make sure that `gem install unicorn -v '4.4.0'` succeeds before bundling.

这是我认为相关的mkmf.log的内容

have_macro: checking for SIZEOF_SIZE_T in ruby.h... -------------------- yes

"gcc -I/home/evergreen/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/x86_64-linux -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/backward -I/home/eg/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1 -I. -I/home/eg/.rvm/usr/include -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4: /*top*/
5: #ifndef SIZEOF_SIZE_T
6: # error
7: >>>>>> SIZEOF_SIZE_T undefined <<<<<<
8: #endif
/* end */

--------------------

have_macro: checking for SIZEOF_LONG in ruby.h... -------------------- yes

最佳答案

确保根据要求安装所有内容:

rvm get head
rvm requirements

关于ruby-on-rails - 使用 Gemfile 中的 'gem unicorn' 将 Rails 应用程序部署到 Ubuntu 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13748995/

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