How to install therubyracer gem on 10.10 Yosemite?

后端 未结 18 956
栀梦
栀梦 2020-11-30 17:21

I don\'t manage to install therubyracer gem on Yosemite 10.10.

Here is the log:

11:53  $ gem install libv8 -v \'3.16.14.3\' -- --with-system-v8


Building         


        
相关标签:
18条回答
  • 2020-11-30 17:52

    I was able to proceed with ruby racer after rm Gemfile.lock

    beforehand: I installed v8 via brew install v8, and then did gem install libv8 -v '3.16.14.3' -- --with-system-v8

    and I am running 10.10 Yosemite

    0 讨论(0)
  • 2020-11-30 17:52

    this happens due to some conflicts with the libv8 as well, although you can just assign a version to the rubyracer and it will be installed:

    change the following in the gemfile:

    gem 'therubyracer', '~> 0.12.1'

    and do bundle install

    0 讨论(0)
  • 2020-11-30 17:54

    None of the answers work for me this time. I have too use this:

    brew tap homebrew/versions
    brew install v8-315
    
    gem install libv8 -v '3.16.14.13' -- --with-system-v8
    gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
    
    bundle install
    

    Seen on the rubyracer Github issues.

    Hope it helps someone else.

    0 讨论(0)
  • 2020-11-30 17:54

    I had the same issue on Yosemite. My solution is similar to what appears above.

    Use gem uninstall libv8 to remove anything that might be installed.

    Leave therubyracer in your Gemfile, but remove any explicit reference to libv8.

    Run bundle install.

    libv8 then installed fine as a dependency.

    0 讨论(0)
  • 2020-11-30 17:54

    Using homebrew's directory of v8 for --with-v8-dir=/usr/local/Cellar/v8@3.15/3.15.11.18_1, instead of /usr/local/opt/v8-315, is what worked for me, in coding addicted's answer.

    This is visible in the Summary of the brew install command, brew install v8-315.

    0 讨论(0)
  • 2020-11-30 17:56

    They have corrected this issue in the most recent version of libv8. See: https://github.com/cowboyd/libv8/issues/123

    You should install from the github repo, in rails I added a line to my gemfile like this gem "libv8", git: "git://github.com/cowboyd/libv8.git", submodules: true

    EDIT:

    This apparently only solves some of the problem. I installed the new version of libv8, but now the rubyracer is still looking for the other one I think? Still looking into it.

    0 讨论(0)
提交回复
热议问题