0

运行时出现此错误cap:deploy

我已经跑apt-get updateapt-get upgrade

我已经运行了捆绑安装,将 Gemfile 和 Gemfile.lock 添加到存储库。

  * executing "cd /var/www/releases/20120606045148 && bundle install --gemfile /var/www/releases/20120606045148/Gemfile --path /var/www/shared/bundle --deployment --quiet --without development test"
    servers: ["11.111.11.11"]
    [11.111.11.11] executing command
 ** [out :: 11.111.11.11] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: 11.111.11.11] 
 ** [out :: 11.111.11.11] /usr/bin/ruby1.9.1 extconf.rb
 ** [out :: 11.111.11.11] Compiling V8
 ** [out :: 11.111.11.11] cp -r scons build
 ** [out :: 11.111.11.11] make: ruby: Command not found
 ** [out :: 11.111.11.11] make: ruby: Command not found
 ** [out :: 11.111.11.11] cd build/v8 && GCC_VERSION= ../scons/install/bin/scons arch=
 ** [out :: 11.111.11.11] scons: Reading SConscript files ...
 ** [out :: 11.111.11.11] Unknown arch value ''.  Possible values are (arm, ia32, x64, mips).
 ** [out :: 11.111.11.11] make: *** [build/v8/libv8.a] Error 1
 ** [out :: 11.111.11.11] *** extconf.rb failed ***
 ** [out :: 11.111.11.11] Could not create Makefile due to some reason, probably lack of
 ** [out :: 11.111.11.11] necessary libraries and/or headers.  Check the mkmf.log file for more
 ** [out :: 11.111.11.11] details.  You may need configuration options.
 ** [out :: 11.111.11.11] 
 ** [out :: 11.111.11.11] Provided configuration options:
 ** [out :: 11.111.11.11] --with-opt-dir
 ** [out :: 11.111.11.11] --without-opt-dir
 ** [out :: 11.111.11.11] --with-opt-include
 ** [out :: 11.111.11.11] --without-opt-include=${opt-dir}/include
 ** [out :: 11.111.11.11] --with-opt-lib
 ** [out :: 11.111.11.11] --without-opt-lib=${opt-dir}/lib
 ** [out :: 11.111.11.11] --with-make-prog
 ** [out :: 11.111.11.11] --without-make-prog
 ** [out :: 11.111.11.11] --srcdir=.
 ** [out :: 11.111.11.11] --curdir
 ** [out :: 11.111.11.11] --ruby=/usr/bin/ruby1.9.1
 ** [out :: 11.111.11.11] extconf.rb:10:in `<main>': Error compiling V8 (RuntimeError)
 ** [out :: 11.111.11.11] 
 ** [out :: 11.111.11.11] 
 ** [out :: 11.111.11.11] Gem files will remain installed in /var/www/shared/bundle/ruby/1.9.1/gems/therubyracer-0.8.2 for inspection.
 ** [out :: 11.111.11.11] Results logged to /var/www/shared/bundle/ruby/1.9.1/gems/therubyracer-0.8.2/ext/v8/gem_make.out
 ** [out :: 11.111.11.11] An error occured while installing therubyracer (0.8.2), and Bundler cannot continue.
 ** [out :: 11.111.11.11] Make sure that `gem install therubyracer -v '0.8.2'` succeeds before bundling.
    command finished in 73622ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/releases/20120606045148; true"
    servers: ["11.111.11.11"]
    [11.111.11.11] executing command
    command finished in 7100ms
failed: "env PATH=/var/lib/gems/1.9.1/bin:$PATH sh -c 'cd /var/www/releases/20120606045148 && bundle install --gemfile /var/www/releases/20120606045148/Gemfile --path /var/www/shared/bundle --deployment --quiet --without development test'" on 11.111.11.11
4

2 回答 2

2

我建议在这里安装 rvm - 正如 Joshua Cheek 所说,问题似乎出在 ruby​​ 二进制文件上,rvm 应该可以帮助解决这个问题。

apt-get install rvm,然后在安装后运行rvm list known,为您提供可用 ruby​​ 版本的列表;rvm install (version)然后安装你想要的rvm use (version)(不包括括号)。

这样做将确保您使用可用ruby的命令和干净的 gemset 干净地安装 ruby​​。

然后您应该能够做到apt-get install libv8- 如果您仍然遇到问题,请使用错误消息进行编辑,我们将从那里开始。

于 2012-08-30T20:19:54.130 回答
1

看起来您的 ruby​​ 二进制文件已命名ruby1.9.1,但它正在尝试调用该二进制文件ruby。您可能可以在路径中的某处放置一个名为“ruby”的符号链接,并将其指向/usr/bin/ruby1.9.1.

于 2012-08-29T22:58:45.747 回答