【问题标题】:Unable to install therubyracer gem无法安装 ruby​​racer gem
【发布时间】:2014-10-02 00:56:17
【问题描述】:

我顺利安装了 libv8 gem,但是当我尝试安装 therubyracer gem 时出现以下错误:

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for main() in -lpthread... yes
Warning! Unable to load libv8 ~> 3.16.14.
*** 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}/
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
    --enable-debug
    --disable-debug
extconf.rb:32:in `<main>': undefined method `configure_makefile' for Libv8:Module (NoMethodError)


Gem files will remain installed in /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1/ext/v8/gem_make.out

不知道该怎么办。

【问题讨论】:

    标签: ruby-on-rails ruby gem installation therubyracer


    【解决方案1】:

    试试这个:

    $ sudo gem install therubyracer --platform ruby
    

    尝试使用或不使用 sudo。

    如果是 Ruby on Rails 应用程序,请包含以下行:

    gem 'therubyracer', :platform=>:ruby
    

    在 Gemfile 中。

    【讨论】:

    • 很遗憾,由于这是一个共享服务器,我没有 sudo 权限,但没有 sudo 就无法工作。
    • 它是 Ruby on Rails 应用程序吗?
    • 如果不可能,请尝试删除 Gemfile.lock,然后使用 --no-deployment 进行 ruby​​。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-24
    • 2011-04-01
    相关资源
    最近更新 更多