加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Rails – 用json捆绑安装问题

发布时间:2020-12-17 02:46:26 所属栏目:百科 来源:网络整理
导读:我正在使用Rails 3.2.12运行OS X Mavericks.当我尝试使用rails new project时,它会在bundle install中遇到困难. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension./usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extcon
我正在使用Rails 3.2.12运行OS X Mavericks.当我尝试使用rails new project时,它会在bundle install中遇到困难.

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

/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb 
creating Makefile

make
compiling generator.c
make: gcc-4.2: No such file or directory
make: *** [generator.o] Error 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/json-1.8.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1),and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

当我做’gem install json ….’时,我得到同样的错误.我已经使用命令行工具安装了最新版本的Xcode.当我做:

which gcc

我明白了:

/usr/bin/gcc

我真的很喜欢这些东西,所以请尽量保持简单.

解决方法

因此,在XCode 5之前,有一个gcc-4.2二进制文件,它在升级中被删除了.

我发现这个tutorial有助于让gcc-4.2恢复并运行ruby.它假设您使用homebrew来管理Mac上的软件包.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读