无法安装therubyracer,错误 [英] Can't install therubyracer, error

查看:99
本文介绍了无法安装therubyracer,错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将therubyracer / therubyracer-heroku安装到我的应用程序,因为它在Heroku服务器中不起作用,因为我没有javascript运行环境。

当我尝试安装这些宝石它写道:

 使用本机扩展安装therubyracer-heroku(0.8.1.pre3)C:/ RailsInsta 
ller / Ruby1.9.2 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:533:in`rescue in
lock in build_extensions':错误:无法构建gem原生扩展。 (Gem :: I
nstaller :: ExtensionBuildError)

C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
rm -rf build
mkdir -p build
cp -r scons build
mkdir -p build / scons / install
python build / scons / setup.py install --prefix = install
make: python:命令未找到
make:*** [build / scons / install / bin / scons]错误127
*** extconf.rb失败***
无法创建Makefile出于某种原因,可能缺少
所需的图书馆和/或标题。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--with-opt-dir
--without-opt-dir
--with-opt-include
- -without-opt-include = $ {opt-dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
--without-make-prog
--srcdir =。
--curdir
--ruby = C:/RailsInstaller/Ruby1.9.2/bin/ruby
extconf.rb:9:在< main>中:错误编译V8(RuntimeError )
编译V8


Gem文件将保持安装在C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9
.1 / gems / therubyracer-heroku-0.8.1.pre3进行检查。
记录到C的结果:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/therubyra
cer-heroku-0.8.1.pre3 / ext / v8 / gem_make.out
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:511:在`block in build_extensions'
from C: /RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:486:在`each'
from C:/RailsInstaller/Ruby1.9.2/lib/ ruby / site_ruby / 1.9.1 / ruby​​gems / insta
ller.rb:486:在`build_extensions'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems / insta
ller.rb:159:在`install'中
从C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/source.rb:101:in`block in install'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/rubygems_integration.rb:78:in`preserve_paths'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundl er-1.0.18
/lib/bundler/source.rb:91:in`install'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/ bundler-1.0.18
/lib/bundler/installer.rb:58:in`block(2 levels)in run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/ 1.9.1 / gems / bundler-1.0.18
/lib/bundler/rubygems_integration.rb:93:in`with_build_args'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/ 1.9.1 / gems / bundler-1.0.18
/lib/bundler/installer.rb:57:in`block in run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/ gems / 1.9.1 / gems / bundler-1.0.18
/lib/bundler/installer.rb:49:in`run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/ gems / 1.9.1 / gems / bundler-1.0.18
/lib/bundler/installer.rb:8:in`install'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/ gems / 1.9.1 / gems / bundler-1.0.18
/lib/bundler/cli.rb:220:in`install'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/宝石/ 1.9.1 / gems / bundler-1.0.18
/ lib / bundler / vendor / thor / task.rb:22:在`run'中
从C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/ lib / bundler / vendor / thor / invocation.rb:118:在`invoke_task'$ C $ /
/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/vendor/thor.rb:263:in`从C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0'调度'
。 18
/lib/bundler/vendor/thor/base.rb:386:in`start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/从C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:在`load()中的$< top(必需)>'
中的bundler-1.0.18
/ bin / bundle:13: 'C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:'< main>'中的

在此先感谢

解决方案

据我所知,therubyracer(-heroku)根本不起作用在Windows上。但Windows有它自己的JavaScript引擎,execjs应该能够找到它。因此,这应该适用于您在Windows上的开发。



为了在Heroku上提供应用程序,您可以添加therubyracer-heroku gem,如下所示:

  gem'therubyracer-heroku','〜> 0.8.1.pre3',:platform => :ruby 

:platform => :ruby 将在C Ruby(MRI)或Rubinius上使用它,但不会在Windows上使用它。

另外,请参阅Heroku的文档: Cedar Stack ;如果您以前使用 therubyracer therubyracer- heroku ,这些宝石不再是必需的,因为这些宝石使用了大量的内存,所以不鼓励这些宝石。



I am trying to instal therubyracer/ therubyracer-heroku to my app, cause it doesn't work in heroku server cause I don't have javascript runtime enviroment.
When I am trying to install these gems it writes:

Installing therubyracer-heroku (0.8.1.pre3) with native extensions C:/RailsInsta
ller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in
block in build_extensions': ERROR: Failed to build gem native extension. (Gem::I
nstaller::ExtensionBuildError)

        C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
rm -rf build
mkdir -p build
cp -r scons build
mkdir -p build/scons/install
python build/scons/setup.py install --prefix=install
make: python: Command not found
make: *** [build/scons/install/bin/scons] Error 127
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/RailsInstaller/Ruby1.9.2/bin/ruby
extconf.rb:9:in `<main>': Error compiling V8 (RuntimeError)
Compiling V8


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9
.1/gems/therubyracer-heroku-0.8.1.pre3 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/therubyra
cer-heroku-0.8.1.pre3/ext/v8/gem_make.out
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:511:in `block in build_extensions'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:486:in `each'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:486:in `build_extensions'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:159:in `install'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/source.rb:101:in `block in install'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/source.rb:91:in `install'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/installer.rb:58:in `block (2 levels) in run'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/installer.rb:57:in `block in run'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/installer.rb:49:in `run'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/installer.rb:8:in `install'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/cli.rb:220:in `install'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/vendor/thor/task.rb:22:in `run'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/vendor/thor.rb:263:in `dispatch'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/lib/bundler/vendor/thor/base.rb:386:in `start'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.18
/bin/bundle:13:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:in `load'
        from C:/RailsInstaller/Ruby1.9.2/bin/bundle:19:in `<main>'

Thanks in advance

解决方案

As far as I know, therubyracer(-heroku) simply does not work on Windows. But Windows has its own JavaScript engine, which execjs should be able to locate. So that should work for your development on Windows.

For serving the app on Heroku, you can add the therubyracer-heroku gem as following:

gem 'therubyracer-heroku', '~> 0.8.1.pre3', :platform => :ruby

:platform => :ruby will use it on C Ruby (MRI) or Rubinius but not Windows.

Also, see Heroku's docs for the Cedar Stack;

If you were previously using therubyracer or therubyracer-heroku, these gems are no longer required and strongly discouraged as these gems use a very large amount of memory.

这篇关于无法安装therubyracer,错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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