Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Ruby on Rails OS X 1.8.4的问题_Ruby On Rails_Ruby_Json_Ruby On Rails 3_Macos - Fatal编程技术网

Ruby on rails Ruby on Rails OS X 1.8.4的问题

Ruby on rails Ruby on Rails OS X 1.8.4的问题,ruby-on-rails,ruby,json,ruby-on-rails-3,macos,Ruby On Rails,Ruby,Json,Ruby On Rails 3,Macos,我在Mac上使用Ruby on Rails时遇到问题。它可能与我的xCode版本或OS X 1.8.4有关。我这么说是因为我过去能够创建RubyonRails应用程序 这是我的问题。当我运行rails new rubyDemo创建一个新的rails应用程序时,出现以下错误: create create README.rdoc create Rakefile create config.ru ... ... Using execjs (2.0.1) Using coffee-scrip

我在Mac上使用Ruby on Rails时遇到问题。它可能与我的xCode版本或OS X 1.8.4有关。我这么说是因为我过去能够创建RubyonRails应用程序

这是我的问题。当我运行
rails new rubyDemo
创建一个新的rails应用程序时,出现以下错误:

create  
create  README.rdoc
create  Rakefile
create  config.ru
...
...
Using execjs (2.0.1) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Installing json (1.8.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Users/tithos/.bundler/tmp/9865/gems/json-1.8.0 for inspection.
Results logged to /Users/tithos/.bundler/tmp/9865/gems/json- 1.8.0/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.8.0), and Bundler cannot continue.
Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.8.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
当我尝试运行
sudogem安装json-v'1.8.0'

我得到以下错误:

create  
create  README.rdoc
create  Rakefile
create  config.ru
...
...
Using execjs (2.0.1) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.3) 
Installing json (1.8.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Users/tithos/.bundler/tmp/9865/gems/json-1.8.0 for inspection.
Results logged to /Users/tithos/.bundler/tmp/9865/gems/json- 1.8.0/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.8.0), and Bundler cannot continue.
Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.8.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
我正在跑步:

ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

rails -v
Rails 3.2.13
我不知道我还丢失了什么宝石和/或碎片

任何帮助都会很好


另外,很抱歉写了这么长的文章

您是否安装了XCode的命令行工具?如果可能的话,我还建议在系统上使用ruby。是的,我确实安装了xCode的cl工具。你是说RVN vs Gem吗?我是说RVM安装一个不同于系统ruby的ruby,并用它来管理你的Gem。这是一个隔离不同版本ruby和已安装gems的好工具。我认为前面的答案会有所帮助。安装json_pure没有帮助