我不管理上约塞米蒂10.10安装therubyracer宝石。
下面是日志:
11:53 $ gem install libv8 -v '3.16.14.3' -- --with-system-v8
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.3
Parsing documentation for libv8-3.16.14.3
Installing ri documentation for libv8-3.16.14.3
Done installing documentation for libv8 after 0 seconds
1 gem installed
02:05 $ gem install therubyracer -v '0.12.1' -- --with-system-v8
Building native extensions with: '--with-system-v8'
This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/usr/local/var/rbenv/versions/2.1.2/bin/ruby extconf.rb --with-system-v8
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** 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/var/rbenv/versions/2.1.2/bin/ruby
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `'
extconf failed, exit code 1
Gem files will remain installed in /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.out
Answer 1:
git clone https://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-3.16.14.3-x86_64-darwin-12.gem #note that libv8 version may change, so tab through files in pkg/, also remember to use the one with version specified
那么就捆绑项目宝石
这仅仅是它为我工作在10.10的方法(红宝石2.1.2)
Answer 2:
gem uninstall libv8
brew install v8
gem install therubyracer
gem install libv8 -v '3.16.14.3' -- --with-system-v8
这仅仅是它为我工作在10.10的方法(红宝石2.1.2)
或尝试gem install libv8 -v 'XX.XX.XX' -- --with-system-v8
加上宝石的版本:)
Answer 3:
答案都不工作了我这一次。 我有太多使用:
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
看到在Github上rubyracer问题。
希望它可以帮助别人。
Answer 4:
也许这将是有用的人,但我有问题,安装therubyracer(因为与libv8问题)的解决办法是卸载 ,我已经安装的所有libv8。 安装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
我希望这可以帮助别人。
Answer 5:
看起来这已得到修复上游。 什么工作对我来说和@aurels和@Mike CAUSER和@Juanda是:
bundle update libv8
Answer 6:
这个工作对我非常好我的优胜美地和Ruby 2.1.5(红宝石通过RVM)
gem install libv8 -v '3.16.14.3' -- --with-system-v8
早些时候,这是给我错误Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
对于libv8宝石版本3.16.14.3
Answer 7:
我能后红宝石赛车进行rm Gemfile.lock
事先:我安装通过V8 brew install v8
,并没有gem install libv8 -v '3.16.14.3' -- --with-system-v8
和我运行10.10优胜美地
Answer 8:
只有这对我的作品在我的优山美地,红宝石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
Answer 9:
他们已经在最近版本libv8的纠正了这个问题。 请参阅: https://github.com/cowboyd/libv8/issues/123
你应该从GitHub库安装在铁轨我添加了一行到我的Gemfile这样的gem "libv8", git: "git://github.com/cowboyd/libv8.git", submodules: true
编辑:
这显然只解决了一些问题。 我安装libv8的新版本,但现在rubyracer仍在寻找另外一个我想? 还是寻找到它。
Answer 10:
我对约塞米蒂同样的问题。 我的解决方案是类似于上面出现。
使用gem uninstall libv8
删除任何可能被安装。
离开therubyracer在你的Gemfile,但删除任何明确提到libv8。
运行bundle install
。
libv8然后装细的依赖。
Answer 11:
更新答案2018。
我在高塞拉利昂,在自制1.6.1
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@3.15/
对我来说是什么工作。
幸得@编码成瘾的他原来的答复 。
Answer 12:
后试图简单地升级红宝石工作时间:
brew install ruby
然后添加以下到宝石文件:
gem 'libv8'
gem 'therubyracer'
Answer 13:
我做了以下
gem install therubyracer
现在安装therubyracer 0.12.1
它安装依赖性libv8 (3.16.14.7 x86_64-darwin-14)
其与没有错误安装。
我这样做是使用ruby 2.1.5
,我通过安装:
CC=/usr/bin/gcc rbenv install 2.1.5
我跑后做brew upgrade ruby-builds
。
安装完成后ruby 2.1.5
,我也跑
gem upgrade --system
让rubygems-update 2.4.5
Answer 14:
这与libv8一些冲突情况发生的原因,以及,虽然你可以分配一个版本到rubyracer,它将被安装:
更改的Gemfile如下:
游戏 'Therubyrcher' 〜> 0.12.1“
并做捆绑安装
Answer 15:
什么工作对我来说,基于以下评论,
https://github.com/cowboyd/therubyracer/issues/304#issuecomment-62046085
是去除Gemfile.lock的,然后运行bundle安装
Answer 16:
抬起头对可能一直有我的问题的人:我结束了在卸载RVM我的红宝石版本,然后重新安装它。 这似乎使用的Xcode开发工具的最新版本正确的依赖关系编译红宝石。
rvm list
rvm uninstall ruby-x.x.x
rvm install ruby-x.x.x
Answer 17:
该解决方案按照上面只是一个微小的改变的Jakub Troszok的解决方案为我
gem uninstall libv8
gem install therubyracer -v '0.12.1'
Fetching: libv8-3.16.14.19-x86_64-darwin-18.gem (100%)
Successfully installed libv8-3.16.14.19-x86_64-darwin-18
Building native extensions. This could take a while...
Successfully installed therubyracer-0.12.1
Parsing documentation for libv8-3.16.14.19-x86_64-darwin-18
Installing ri documentation for libv8-3.16.14.19-x86_64-darwin-18
Parsing documentation for therubyracer-0.12.1
Installing ri documentation for therubyracer-0.12.1
Done installing documentation for libv8, therubyracer after 0 seconds
2 gems installed
gem install libv8 -v '3.16.14.17' -- --with-system-v8 (if the libv8 version required for your project is different from the one installed by rubyracer)
bundle install
文章来源: How to install therubyracer gem on 10.10 Yosemite?