therubyracer install error

断了今生、忘了曾经 提交于 2019-11-29 22:12:20

You can use the Libv8 from the brew instead of the one from gem. You can do that by following commands:

$ gem uninstall libv8
$ brew install v8
$ gem install therubyracer

For an older project I had to used the 0.10.1 version of rubyracer on mavericks (bootstrap depends on it)

So I had to use an older version of gcc

  1. edit your .zshrc or .bashrc

    export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
    export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
    export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2
    
  2. be sure that you have uninstalled all older versions of libv8

    gem uninstall libv8
    
  3. install your version of therubyracer

    gem install therubyracer -v=0.10.1
    

For Linux:

The code below is of course correct

$ gem uninstall libv8

$ gem install therubyracer

But sometimes it does't help because you haven't program make. AT FIRST you need install make. To do this, run:

sudo apt-get install build-essential

And only after that:

gem install therubyracer

On Mavericks, you just need to update to therubyracer 0.12.0

The solution that worked for me was putting these steps together on 10.7.4

export CC=gcc-4.2

sudo ln /usr/bin/gcc /usr/bin/gcc-4.2

gem uninstall libv8
gem install therubyracer

Mac 10.10.5, Ruby 2.1.0 this worked for me:

gem uninstall libv8
gem uninstall therubyracer

brew upgrade gcc
brew install v8

bundle config --local build.libv8 --with-cxx=/usr/local/bin/gcc-6
gem install libv8 -v '3.16.14.17' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315

bundle install # worked !
senration

I've had the exact same issue just till now.

This link saved me.

to sum up, you need to do this:

$ gem uninstall libv8
$ gem install therubyracer

before i fixed this issue, i had v8 installed in my mac. i don't know if this helped, since it seems have sth to do with js interpreter, I thought it might help.

On Mountain Lion 10.8, it doesn't come preinstalled with a C compiler. You'll need to download and install the 'command line tools' package from Apple themselves, and then run which gcc to confirm it is installed. Everything should run fine from there on in.

On OS X 10.7 I actually found that the "Command Line Tools" package wasn't enough, I had to install the full-blown XCode package, then gem install worked.

I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks.

Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me. If you are on ruby-1.93-p125, you may want to try upgrading to 1.9.3-rc1 (which is above p484 already)

libv8 (3.16.14.3-x86_64-darwin-13) and the therubyracer (0.12.0) gems installed without problem.

assuming you use rbenv:

rbenv install 1.9.3-rc1
rbenv rehash
rbenv shell 1.9.3-rc1
bundle install

According to https://github.com/cowboyd/therubyracer/issues/420#issuecomment-253592865

gem uninstall therubyracer
gem uninstall libv8
brew uninstall v8
brew install v8
gem install libv8
gem install therubyracer

It helped me. Parameters: ruby 2.3.3, rails 4.2.9

@Haegin's answer in https://github.com/cowboyd/libv8/issues/205

brew uninstall v8
brew install v8-315
gem uninstall -a libv8
gem uninstall -a therubyracer
gem install libv8 -v '3.16.14.17' -- --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-v8-dir=$(brew --prefix v8-315)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!