我使用 Rails 3.1.1 和 Ruby 1.8.7,在 PhusionPassenger 中出现“无法启动 Ruby(Rack)应用程序”错误。它指出“找不到 JavaScript 运行时。请参见https://github.com/sstephenson/execjs查看可用运行时列表。(ExecJS::RuntimeUnavailable)”。在 Dreamhost 的 wiki 上搜索这个问题时,建议安装“therubyracer” gem。
因此,我按照建议更新了我的 gemfile,如下所示:
编辑:我还尝试添加以下内容到文件中:gem 'therubyracer','~> 0.9.9'
但它没有起作用。gem 'therubyracer',:platforms => :ruby
然后,在我的 MacBook 上运行“bundle install”时没有任何问题。但是,当我运行“cap deploy”将其放在 Dreamhost 上时,它失败了;当它尝试安装 therubyracer 依赖项 libv8 时,我看到了一个错误。
有人知道如何正确安装它或其他有效的解决方案吗?
可以根据需要提供任何其他信息。
终端的完整错误反馈:
执行 "cd /home/futureproof/abunchofletters.co.uk/releases/20111118003703 && bundle install --gemfile /home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile --path /home/futureproof/.gems/bundle --deployment --quiet --without development test" servers: ["abunchofletters.co.uk"] [abunchofletters.co.uk] 执行命令 ** [out :: abunchofletters.co.uk] 很不幸,发生了致命错误。 请将此错误报告给Bundler问题跟踪器https://github.com/carlhuda/bundler/issues以便我们修复它。 谢谢! ** [out :: abunchofletters.co.uk] /usr/lib/ruby/1.8/rubygems/installer.rb:483:in
build_extensions':
ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError) ** [out ::
abunchofletters.co.uk] ** [out :: abunchofletters.co.uk]
/usr/bin/ruby1.8 extconf.rb ** [out :: abunchofletters.co.uk] ***
extconf.rb failed *** ** [out :: abunchofletters.co.uk] Could not
create Makefile due to some reason, probably lack of ** [out ::
abunchofletters.co.uk] necessary libraries and/or headers. Check the
mkmf.log file for more ** [out :: abunchofletters.co.uk] details.
You may need configuration options. ** [out :: abunchofletters.co.uk]
** [out :: abunchofletters.co.uk] 提供的配置选项: ** [out :: abunchofletters.co.uk] --with-opt-dir ** [out ::
abunchofletters.co.uk] --without-opt-dir ** [out ::
abunchofletters.co.uk] --with-opt-include ** [out ::
abunchofletters.co.uk] --without-opt-include=${opt-dir}/include **
[out :: abunchofletters.co.uk] --with-opt-lib ** [out ::
abunchofletters.co.uk] --without-opt-lib=${opt-dir}/lib ** [out ::
abunchofletters.co.uk] --with-make-prog ** [out ::
abunchofletters.co.uk] --without-make-prog ** [out ::
abunchofletters.co.uk] --srcdir=. ** [out :: abunchofletters.co.uk]
--curdir ** [out :: abunchofletters.co.uk] --ruby=/usr/bin/ruby1.8 ** [out :: abunchofletters.co.uk] extconf.rb:13: uninitialized constant Gem (NameError) ** [out :: abunchofletters.co.uk] Checking
for Python... ** [out :: abunchofletters.co.uk] ** [out ::
abunchofletters.co.uk] Gem files will remain installed in
/home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4 for
inspection. ** [out :: abunchofletters.co.uk] Results logged to
/home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
** [out :: abunchofletters.co.uk] from /usr/lib/ruby/1.8/rubygems/installer.rb:446:in
each' ** [out ::
abunchofletters.co.uk] from
/usr/lib/ruby/1.8/rubygems/installer.rb:446:in build_extensions' **
[out :: abunchofletters.co.uk] from
/usr/lib/ruby/1.8/rubygems/installer.rb:198:in
install' ** [out ::
abunchofletters.co.uk] from
/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:90:in
install' ** [out :: abunchofletters.co.uk] from
/home/futureproof/.gems/gems/bundler-1.1
libv8-dev
则不会。 - Jeromebrew install node
。 - Darkaico