How to install therubyracer gem on 10.10 Yosemite?

后端 未结 18 957
栀梦
栀梦 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 18:04

    This worked for me very well on my Yosemite and Ruby 2.1.5 (Ruby through RVM)

    gem install libv8 -v '3.16.14.3' -- --with-system-v8
    

    Earlier it was giving me error Gem::Ext::BuildError: ERROR: Failed to build gem native extension. for libv8 gem version 3.16.14.3

    0 讨论(0)
  • 2020-11-30 18:09

    Only this works for me in my Yosemite, Ruby 2.1.2:

    gem install libv8 -v '3.16.14.3' -- --with-system-v8
    brew link --overwrite v8-315 --force
    gem install therubyracer -v '0.12.2' -- --with-system-v8
    
    0 讨论(0)
  • 2020-11-30 18:12

    Maybe it will be useful for someone but I had problems installing therubyracer (because of the problems with libv8) the solution was to uninstall all the libv8 that I had installed. Install therubyracer

    $ gem uninstall libv8
    $ gem install therubyracer -v '0.12.0'
    Fetching: libv8-3.16.14.7-x86_64-darwin-14.gem ( 57%)
    Fetching: libv8-3.16.14.7-x86_64-darwin-14.gem (100%)
    Successfully installed libv8-3.16.14.7-x86_64-darwin-14
    Building native extensions.  This could take a while...
    Successfully installed therubyracer-0.12.0
    2 gems installed
    

    I hope this helps someone.

    0 讨论(0)
  • 2020-11-30 18:12

    After hours of trying simply upgrading ruby worked:

    brew install ruby 
    

    and then adding the following to gem file:

    gem 'libv8'  
    gem 'therubyracer' 
    
    0 讨论(0)
  • 2020-11-30 18:18

    What worked for me, based on the following comment,

    https://github.com/cowboyd/therubyracer/issues/304#issuecomment-62046085

    was to remove Gemfile.lock and then run bundle install

    0 讨论(0)
  • 2020-11-30 18:19

    A heads up to anyone that might have been having my issue: I ended up uninstalling my ruby version in RVM and then reinstalling it. That seemed to use the correct dependancies in the latest version of xcode tools for compiling ruby.

    rvm list
    rvm uninstall ruby-x.x.x
    rvm install ruby-x.x.x
    
    0 讨论(0)
提交回复
热议问题