Rails:找不到 JavaScript 运行时.有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs.(ExecJS::RuntimeUnavailable) [英] Rails: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

查看:54
本文介绍了Rails:找不到 JavaScript 运行时.有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs.(ExecJS::RuntimeUnavailable)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从 Dreamhost 几周前升级了他们的服务器后,我的网站就被破坏了.我一直在努力修复它并取得了一些进展,但我仍然坚持希望是最后一个问题.

My website has been broken since Dreamhost upgraded their servers a couple of weeks ago. I have been tearing my hair out trying to get it fixed and made some progress but am stuck on what is hopefully the final issue.

我在 Ruby 1.8.7 上使用 Rails 3.1.1,并收到来自 PhusionPassenger 的Ruby (Rack) 应用程序无法启动错误".它声明它找不到 JavaScript 运行时".有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs.(ExecJS::RuntimeUnavailable)'.在 Dreamhost 的 wiki 上搜索此内容已建议安装therubyracer" gem 的解决方案.

I'm using Rails 3.1.1 on Ruby 1.8.7 and get presented with a 'Ruby (Rack) application could not be started error' from PhusionPassenger. It states that it 'Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)'. Searching for this on Dreamhost's wiki has suggested a solution to install 'therubyracer' gem.

所以我用建议的 gem 更新了我的 gemfile,如下所示:

So I updated my gemfile with the suggested gem like so:

宝石 'therubyracer', '~> 0.9.9'

gem 'therubyracer', '~> 0.9.9'

我也尝试添加到文件中:

I have also tried adding to the file with:

gem 'therubyracer', :platforms => :ruby

gem 'therubyracer', :platforms => :ruby

但它并没有产生任何影响.

but it hasn't made a difference.

然后捆绑安装在我的 Macbook(运行 OS X 10.5.8)上.但是,当我运行cap deploy"来安装 Dreamhost 时,这会失败;我在尝试安装 therubyracer 所依赖的 libv8 时看到错误.

Then bundle installed on my Macbook (running OS X 10.5.8) without hitch. However, this fails when I run 'cap deploy' to put on Dreamhost; I see an error when it attempts to install libv8 which therubyracer depends on.

有人知道如何正确安装它或任何其他有效的解决方案吗?

Anyone know how to get this to install correctly or any other working solution?

可应要求提供任何其他信息.

Any other info can be provided upon request.

来自终端的完整错误反馈:

Full error feedback from Terminal:

  • 正在执行cd/home/futureproof/abunchofletters.co.uk/releases/20111118003703 &&捆绑安装 --gemfile/home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile--path/home/futureproof/.gems/bundle --deployment --quiet --without development test"服务器:[abunchofletters.co.uk"][abunchofletters.co.uk] 正在执行命令 ** [out :: abunchofletters.co.uk] 不幸的是,发生了致命错误.请将此错误报告给 Bundler 问题跟踪器,网址为https://github.com/carlhuda/bundler/issues 以便我们修复它.谢谢!** [出 :: abunchofletters.co.uk]/usr/lib/ruby/1.8/rubygems/installer.rb:483:in build_extensions':错误:无法构建 gem 本机扩展.(Gem::Installer::ExtensionBuildError) ** [out ::abunchofletters.co.uk] ** [出 :: abunchofletters.co.uk]/usr/bin/ruby1.8 extconf.rb ** [out :: abunchofletters.co.uk] ***extconf.rb 失败 *** ** [out :: abunchofletters.co.uk] 无法由于某种原因创建 Makefile,可能缺少 ** [out ::abunchofletters.co.uk] 必要的库和/或头文件.检查mkmf.log 文件以获取更多 ** [out :: abunchofletters.co.uk] 详细信息.您可能需要配置选项.** [出 :: 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 **[出 :: abunchofletters.co.uk] --with-opt-lib ** [出 ::abunchofletters.co.uk] --without-opt-lib=${opt-dir}/lib ** [out ::abunchofletters.co.uk] --with-make-prog ** [出 ::abunchofletters.co.uk] --without-make-prog ** [out ::abunchofletters.co.uk] --srcdir=.** [出 :: abunchofletters.co.uk]--curdir ** [out :: abunchofletters.co.uk] --ruby=/usr/bin/ruby1.8 ** [out :: abunchofletters.co.uk] extconf.rb:13: 未初始化的常量 Gem (NameError) ** [出 :: abunchofletters.co.uk] 检查对于 Python... ** [出 :: abunchofletters.co.uk] ** [出 ::abunchofletters.co.uk] Gem 文件将保持安装在/home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4 for检查.** [出 :: abunchofletters.co.uk] 结果记录到/home/futureproof/.gems/bundle/ruby/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out** [out :: abunchofletters.co.uk] 来自/usr/lib/ruby/1.8/rubygems/installer.rb:446:ineach' ** [out ::abunchofletters.co.uk] 来自/usr/lib/ruby/1.8/rubygems/installer.rb:446:in build_extensions' **[出 :: abunchofletters.co.uk] 来自/usr/lib/ruby/1.8/rubygems/installer.rb:198:ininstall' ** [out ::abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:90:ininstall' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:78:inpreserve_paths' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:89:ininstall' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:ininstall_gem_from_spec' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:93:inwith_build_args' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:ininstall_gem_from_spec' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:inrun' ** [out :: abunchofletters.co.uk] from/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:inrun' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:ininstall' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:ininstall' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:insend' ** [out :: abunchofletters.co.uk] from/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:inrun' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:ininvoke_task' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:indispatch' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:instart' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/gems/bundler-1.1.rc/bin/bundle:13 ** [out ::abunchofletters.co.uk] 来自/home/futureproof/.gems/bin/bundle:19:inload' ** [out :: abunchofletters.co.uk] 来自/home/futureproof/.gems/bin/bundle:19命令在 13170 毫秒内完成*** [deploy:update_code] 回滚 * 执行rm -rf/home/futureproof/abunchofletters.co.uk/releases/20111118003703; true"服务器:[abunchofletters.co.uk"][abunchofletters.co.uk] 执行命令命令在 563 毫秒内完成失败:sh -c 'cd/home/futureproof/abunchofletters.co.uk/releases/20111118003703 &&捆绑安装 --gemfile/home/futureproof/abunchofletters.co.uk/releases/20111118003703/Gemfile--path/home/futureproof/.gems/bundle --deployment --quiet --without development test'" on abunchofletters.co.uk
  • executing "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] executing command ** [out :: abunchofletters.co.uk] Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! ** [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] Provided configuration options: ** [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:ineach' ** [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:ininstall' ** [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.rc/lib/bundler/rubygems_integration.rb:78:in preserve_paths' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:in install_gem_from_spec' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:93:in with_build_args' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:in install_gem_from_spec' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:in install' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in send' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in run' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:in invoke_task' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:in dispatch' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:in start' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/gems/bundler-1.1.rc/bin/bundle:13 ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/bin/bundle:19:in load' ** [out :: abunchofletters.co.uk] from /home/futureproof/.gems/bin/bundle:19 command finished in 13170ms *** [deploy:update_code] rolling back * executing "rm -rf /home/futureproof/abunchofletters.co.uk/releases/20111118003703; true" servers: ["abunchofletters.co.uk"] [abunchofletters.co.uk] executing command command finished in 563ms failed: "sh -c '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'" on abunchofletters.co.uk

推荐答案

libv8 是一个操作系统库;您需要安装正确的 Linux 系统库.如果你运行的是 Ubuntu,它是

libv8 is an OS library; you'll need to install the correct Linux system library. If you're running Ubuntu, it's

sudo apt-get install libv8-dev

或者,您可以安装 node.js,它可以作为 Debian/Ubuntu 软件包用于各种发行版,例如http://ppa.launchpad.net/chris-lea/node.js/ubuntu

Alternatively, you can install node.js which is available as a Debian/Ubuntu package for various distros, e.g. http://ppa.launchpad.net/chris-lea/node.js/ubuntu

通过在 Heroku 上进行部署,您可以省去很多麻烦,而无需为 gems 管理操作系统或组件.

You may save yourself a lot of trouble by deploying on Heroku instead where you don't have to manage the OS or components for gems.

这篇关于Rails:找不到 JavaScript 运行时.有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs.(ExecJS::RuntimeUnavailable)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆