我使用此命令安装Rails。
sudo gem install rails -V
然后我收到此错误消息。没有关于原因的想法...
[root@li608-165 ~]# sudo gem install rails -V
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=actionmailer,actionpack,actionview,activemodel,activerecord,a ctivesupport,bundler,railties,sprockets-rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=arel,builder,erubis,i18n,json,mail,minitest,rack,rack-test,ra ke,sprockets,thor,thread_safe,tzinfo
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=hike,mime-types,multi_json,tilt,treetop
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=polyglot,polyglot
200 OK
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/.gitignore
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/.travis.yml
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/CHANGES
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/COPYING
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/COPYING-json-jruby
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/GPL
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/Gemfile
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/README-json-jruby.markdown
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/README.rdoc
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/Rakefile
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/TODO
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/VERSION
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/example.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/index.html
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/data/prototype.js
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/diagrams/.keep
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/fbuffer/fbuffer.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/depend
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/extconf.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/generator.c
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/generator.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/depend
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/extconf.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.c
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.h
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/parser/parser.rl
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/install.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/ByteListTranscoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Generator.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorMethods.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorService.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/GeneratorState.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/OptionsReader.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Parser.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Parser.rl
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/ParserService.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/RuntimeInfo.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/StringDecoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/StringEncoder.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/java/src/json/ext/Utils.java
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json-java.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/json_pure.gemspec
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/bigdecimal.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/complex.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/core.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/date.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/date_time.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/exception.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/ostruct.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/range.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/rational.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/regexp.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/struct.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/symbol.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/add/time.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/common.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/ext.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/ext/.keep
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure/generator.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/pure/parser.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/lib/json/version.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail1.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail10.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail11.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail12.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail13.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail14.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail18.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail19.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail2.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail20.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail21.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail22.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail23.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail24.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail25.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail27.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail28.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail3.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail4.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail5.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail6.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail7.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail8.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/fail9.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass1.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass15.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass16.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass17.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass2.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass26.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/fixtures/pass3.json
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/setup_variant.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_addition.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_encoding.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_fixtures.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generate.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_string_matching.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_unicode.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tools/fuzz.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tools/server.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_addition.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_encoding.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_fixtures.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generate.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_generic_object.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_string_matching.rb
/usr/lib64/ruby/gems/1.8/gems/json-1.8.1/tests/test_json_unicode.rb
Building native extensions. This could take a while...
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
Building has failed. See above output for more information on the failure.
extconf failed, exit code 1
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/extensions/x86_64-linux/1.8/json-1.8.1/gem_make.out
系统:CentOS 6.5 Ruby:1.8.7
答案 0 :(得分:0)
查看一些日志
在/usr/lib/ruby/ruby.h
找不到ruby的头文件
这意味着你没有ruby-devel
安装ruby-devel
在CentOS
:
sudo yum install ruby-devel