无法在 JRuby 中安装 therubyracer

发布于 2024-12-28 13:07:05 字数 1229 浏览 0 评论 0原文

我已经安装了 RVM,然后安装了 Jruby,这是我输入时得到的版本: jruby -v:

jruby 1.6.5.1 (ruby-1.8.7-p330) (2011-12-27 1bf37c2) (Java HotSpot(TM)客户端VM 1.7.0_02) [linux-i386-java]

问题是我无法安装therubyracer gem,当我尝试通过 jruby -S gem install therubyracer 安装时,我得到了这个:

/usr/local/rvm/rubies/jruby-1.6.5.1/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very we$
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
Checking for Python...Unable to build libv8: Python not found!
*** 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=/usr/local/rvm/rubies/jruby-1.6.5.1/bin/jruby

我也尝试使用 --1.9 参数,强制使用另一个 ruby​​ 版本,但它仍然失败。即使我尝试安装 libv8,但我得到了上面相同的错误。

有什么想法吗? 我有 CentOS 5.7

I've installed RVM and then Jruby, this the version that i get when i type: jruby -v:

jruby 1.6.5.1 (ruby-1.8.7-p330) (2011-12-27 1bf37c2) (Java HotSpot(TM) Client VM 1.7.0_02) [linux-i386-java]

The problem is that I can't install therubyracer gem, i get this when i try to install by jruby -S gem install therubyracer:

/usr/local/rvm/rubies/jruby-1.6.5.1/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very we$
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
Checking for Python...Unable to build libv8: Python not found!
*** 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=/usr/local/rvm/rubies/jruby-1.6.5.1/bin/jruby

I also tried with --1.9 parameter, to force to use another ruby version, but it fails anyway. Even I tried to install libv8, but i get the same error above.

Any ideas?
I have CentOS 5.7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

探春 2025-01-04 13:07:05

您想要 Ruby Rhino

You want the Ruby Rhino.

高速公鹿 2025-01-04 13:07:05

只是为了澄清一下,在您的 Gemfile 中是:

gem 'therubyrhino'

在命令行上跟随:

jruby -S bundle install

Just to clarify, in your Gemfile it's:

gem 'therubyrhino'

followed on the command line with:

jruby -S bundle install
貪欢 2025-01-04 13:07:05

我也遇到了同样的问题,但是在 Gemfile 中定义 therubyrhino 并没有解决我的问题,bundler 一直尝试安装 libv8。

发生这种情况是因为我在 Gemfile 中定义了 twitter-bootstrap-rails gem,并且它依赖于 less gem(依赖于 therubyracer),所以我将 less gem 更改为使用不依赖于 less 的静态分支(如建议的那样)问题 https://github.com/seyhunak/twitter-bootstrap-rails/issues/22):

gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"

I've had the same problem, but defining therubyrhino in the Gemfile didn't solve my problem, bundler kept trying to install libv8.

That happened because I defined twitter-bootstrap-rails gem in the Gemfile, and it depends on the less gem (that depends on therubyracer), so I changed the less gem to use the static branch that not depends on less (as suggested on the issue https://github.com/seyhunak/twitter-bootstrap-rails/issues/22):

gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文