therubyracer安装错误.我尝试了所有其他SO解决方案,但仍然没有运气 [英] therubyracer install error. I tried all other SO solutions and still no luck

查看:193
本文介绍了therubyracer安装错误.我尝试了所有其他SO解决方案,但仍然没有运气的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是在Rails中安装therubyracer gem的常见问题.它是twitter-bootstrap-rails gem的依赖项.

I think this is a common problem of installing therubyracer gem in Rails. It is a dependency for the twitter-bootstrap-rails gem.

我尝试过这样的解决方案: 在Mac OS X上`gem install therubyracer`失败狮子

I have tried solution such as this: `gem install therubyracer` fails on Mac OS X Lion

这是我的gem文件中最相关的部分:

Here is the portion of my gem file that's relavant:

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'

  gem 'twitter-bootstrap-rails'
end

这是我运行捆绑软件安装时遇到的错误:

And here is the error I got when running bundle install:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/lionel_lei/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for main() in -lobjc... yes
creating Makefile

make
compiling rr.cpp
make: clang++: No such file or directory
make: *** [rr.o] Error 1


Gem files will remain installed in /Users/lionel_lei/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.10.2 for inspection.
Results logged to /Users/lionel_lei/.rvm/gems/ruby-1.9.3-p194/gems/therubyracer-0.10.2/ext/v8/gem_make.out
An error occured while installing therubyracer (0.10.2), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.10.2'` succeeds before bundling.

我的系统环境是: 导轨3.2.6 红宝石1.9.3p194(2012-04-20修订版35410)[x86_64-darwin11.4.1] Mac OSX 10.7.4(狮子) Xcode 4.5

My system environment is: Rails 3.2.6 ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.1] Mac OSX 10.7.4 (lion) Xcode 4.5

  • 我一直在拔头发.我是不熟悉ruby/rails的人,哎呀,我一般来说都不熟悉编码,所以错误消息对我来说意义不大.我猜这是某种编译器问题.

感谢您的帮助.

推荐答案

我遇到了相同的问题,我通过安装libv8(gem install libv8)然后安装了therubyracer来解决了该问题.您首先需要安装Apple XCode(从App Store安装),因为其中包括构建libv8所需的c编译器.

I experienced the same problem, which I resolved by installing libv8 (gem install libv8), then installing therubyracer. You will need to have Apple XCode installed first (install from the App Store) as this includes the c compiler that you will need to build libv8.

安装XCode后,如果使用最新版本,则需要手动安装命令行工具"以获取c编译器,您可以在XCode->首选项->下载中找到它. ->安装命令行工具.

Once you have installed XCode, if you are using the latest version you will need to manually install the "command line tools" to get the c compiler, you can find this in XCode --> preferences --> downloads --> install command line tools.

这篇关于therubyracer安装错误.我尝试了所有其他SO解决方案,但仍然没有运气的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆