gpt4 book ai didi

heroku - 无法安装therubyracer,报错

转载 作者:行者123 更新时间:2023-11-30 10:47:07 29 4
gpt4 key购买 nike

我正在尝试将 therubyracer/therubyracer-heroku 安装到我的应用程序,因为它在 heroku 服务器中不起作用,因为我没有 javascript 运行时环境。
当我尝试安装这些 gem 时,它写道:

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>'

提前致谢

最佳答案

据我所知,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 ;

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.

关于heroku - 无法安装therubyracer,报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7658793/

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