Ruby on rails Json gem安装失败。Xcode已安装且为最新版本

Ruby on rails Json gem安装失败。Xcode已安装且为最新版本,ruby-on-rails,ruby,json,xcode,rubygems,Ruby On Rails,Ruby,Json,Xcode,Rubygems,我在尝试运行捆绑程序时遇到以下错误 bundle install Fetching gem metadata from https://rubygems.org/........... Fetching version metadata from https://rubygems.org/.. Using rake 10.0.4 Using i18n 0.6.1 Using multi_json 1.7.3 Using activesupport 3.2.13 Using builder 3.0

我在尝试运行捆绑程序时遇到以下错误

bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Using rake 10.0.4
Using i18n 0.6.1
Using multi_json 1.7.3
Using activesupport 3.2.13
Using builder 3.0.4
Using activemodel 3.2.13
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.2
Using hike 1.2.2
Using tilt 1.4.1
Using sprockets 2.2.2
Using actionpack 3.2.13
Using mime-types 1.23
Using polyglot 0.3.3
Using treetop 1.4.12
Using mail 2.5.4
Using actionmailer 3.2.13
Using arel 3.0.2
Using tzinfo 0.3.37
Using activerecord 3.2.13
Using activeresource 3.2.13
Using coffee-script-source 1.6.2
Using execjs 1.4.0
Using coffee-script 2.2.0
Using rack-ssl 1.3.3

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/camerons/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150331-784-1yax4yj.rb extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                              ^
/Users/camerons/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:793:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ (    \
        ^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' [-Wint-conversion]
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
          ^        ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/camerons/.rvm/gems/ruby-2.2.0/gems/json-1.8.0 for inspection.
Results logged to /Users/camerons/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/json-1.8.0/gem_make.out
An error occurred while installing json (1.8.0), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.0'` succeeds before bundling.
我试着运行gem安装json 1.8.0,结果出现了这个错误

gem install json -v '1.8.0'
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    /Users/camerons/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150331-884-1wle120.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                              ^
/Users/camerons/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:793:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ (    \
        ^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' [-Wint-conversion]
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
          ^        ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/camerons/.rvm/gems/ruby-2.2.0/gems/json-1.8.0 for inspection.
Results logged to /Users/camerons/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/json-1.8.0/gem_make.out
我知道它不是xcode,因为它说它已经安装好了,我刚刚对它进行了最新的软件更新


任何建议都将不胜感激

我今天在osx yosemite上遇到了json 1.7.3 gem,我不知道为什么。对于这个问题,我尝试了几乎所有推荐的方法——设置Archflags、更新命令行工具等等。我认为我想要运行的项目太旧了(没有版本的gem install json运行得很好),我放弃了。坦率地说,我不知道bundle install为什么要加载json 1.7.3

尝试使用gemeset将所有应用程序依赖项彼此分离。有时,这解决了问题

rvm gemset create [some name]
rvm gemset use [some name]
bundle install

我希望这有帮助!我知道这不是一个真正的答案,但stackoverflow不会让我评论,直到我有更多的信誉点。我会关注你的问题,看看是否有人能给你答案。

看来json-1.8.2在ruby 2.2.2下安装得很干净。我以前遇到过同样的问题。

我遇到了同样的问题,这是因为我的代码(repo)使用的是旧版本的Ruby

当我将cd刻录到目录时,我收到以下消息:

furian:Hetzner danebalia$ cd X_installer/
ruby-1.9.3-p194 is not installed.
To install do: 'rvm install ruby-1.9.3-p194'

安装丢失的Ruby版本后,错误消失了。

这是因为json版本不兼容;尝试将
gem文件
修改为最新的gem。看