为什么不能在OS X 10.8上安装json 1.7.4 gem? [英] Why won't bundler install the json 1.7.4 gem on OS X 10.8?
问题描述
当我从git复制我的rails项目并运行时:
我使用XCode 4.4,Ruby 1.9.3和Rails 3.2在OS X 10.8上。 / p>
捆绑安装
我得到:
安装json(1.7.4)
Errno :: EPERM:不允许操作 - /Users/myuser/.rvm/ gems / ruby-1.9.3-p0 / gems / json-1.7.4 / .gitignore
安装json(1.7.4)时发生错误,并且Bundler无法继续。
确保 gem install json -v'1.7.4'
在捆绑之前成功。
然后我试试:
gem install json -v'1.7.4'
并获得:
$ b 错误:执行gem时(Errno :: EPERM)
操作不允许 - /Users/scalessec/.rvm/gems/ruby-1.9.3-p0/gems/json-1.7.4/.gitignore
好的。权限问题,对吗?让我们试试:
sudo gem install json -v'1.7.4'
不行。这是我得到的:
构建原生扩展。这可能需要一段时间...
错误:安装json时出错:
错误:无法构建gem原生扩展。
<用户名> / users /.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
创建Makefile
make
编译generator.c
make:/usr/bin/gcc-4.2:Permission denied
make: * [generator.o] Error 1
我的导轨配置工作正常)。
和我有相同的json 1.7.4问题。
最后,我通过注意到Xcode的命令行工具没有安装(但它们在OS X 10.7!)。 我只是在Xcode中重新安装了CLI工具,并且json 1.7.4问题消失了。 =http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion =nofollow> http://robots.thoughtbot.com/post/ 27985816073 / the-hitchhikers-guide-to-riding-a-mountain-lion
I'm on OS X 10.8 with XCode 4.4, Ruby 1.9.3, and Rails 3.2.
When I clone my rails project from git and run:
bundle install
I get:
Installing json (1.7.4)
Errno::EPERM: Operation not permitted - /Users/myuser/.rvm/gems/ruby-1.9.3-p0/gems/json-1.7.4/.gitignore
An error occurred while installing json (1.7.4), and Bundler cannot continue.
Make sure that gem install json -v '1.7.4'
succeeds before bundling.
Then I try:
gem install json -v '1.7.4'
and get:
ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /Users/scalessec/.rvm/gems/ruby-1.9.3-p0/gems/json-1.7.4/.gitignore
Okay. Permissions issue, right? Let's try:
sudo gem install json -v '1.7.4'
No go. Here's what I get:
Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension.
/Users/myuser/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb creating Makefile
make compiling generator.c make: /usr/bin/gcc-4.2: Permission denied make: * [generator.o] Error 1
What the heck?
I am not sure, but i upgraded to OS X 10.8 2 days ago (from Lion where my rails configuration worked fine). And i had the same json 1.7.4 issue.
Eventually i solved the problem by noticing that Xcode's command line tools where NOT installed (but they were on OS X 10.7!). I just reinstalled CLI tools in Xcode and that json 1.7.4 issue dissappeared.
Also just in case check out this guide: http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
这篇关于为什么不能在OS X 10.8上安装json 1.7.4 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!