json Errno :: EPERM操作不允许

时间:2012-02-11 12:26:55

标签: ruby-on-rails json

而且,是的,另一个类似类型的问题但没有发布的问题帮助了我的情况。一直试图解决这个问题两天。

当我在现有应用中输入'rails new app'或运行'bundle install'时,我得到:

Errno::EPERM: Operation not permitted - /Users/pb/.rvm/gems/ruby-1.9.2-p290/gems/json-   1.6.5/.gitignore
An error occured while installing json (1.6.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.5'` succeeds before bundling.

当我在现有项目中键入任何rails命令时,我得到:

Could not find json-1.6.5 in any of the sources
Run `bundle install` to install missing gems.

当我输入sudo gem install json -v'1.6.5'时,我得到:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
  ERROR: Failed to build gem native extension.

/Users/pb/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb creating Makefile

make
/usr/bin/gcc-4.2 -I. -I/Users/pb/.rvm/rubies/ruby-1.9.2-p290/include/ruby
-1.9.1/x86_64-darwin10.8.0 -I/Users/pb/.rvm/rubies/ruby
-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/pb/.rvm/rubies/ruby-1.9.2 p290/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SO
URCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe -O3 -Wall  -o parser.o -c parser.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [parser.o] Error 1

我已经尝试了以下所有内容:

Uninstall gem json (this tells me json is not installed)
sudo gem update rails

我还安装了最新的xCode - 4.2.1。

非常感谢任何解决我问题的建议!

2 个答案:

答案 0 :(得分:2)

Soooo,我刚刚遇到同样问题的版本......原来是因为我在BYOBU。退出byobu,只是从原始终端工作修复它...不要问我怎么做。

答案 1 :(得分:0)

发生这种情况的一个可能原因是您使用的是rails 3.2,而应用程序是rails 3.1。

执行bundle install并尝试再次运行它。

相关问题