0

オンライン チュートリアルで Ruby on Rails を学ぼうとしています。

[rails version]: Rails 3.2.13
[ruby version] : ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]

コマンドを実行すると:

rails new first_app

私は得る:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h


Gem files will remain installed in /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7 for inspection.
Results logged to /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.7.7), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.7'` succeeds before bundling.

案の定、gem install json -v '1.7.7リストどおりに実行しましたが、結果は次のとおりです。

[philippe@localhost rails_projects]$ gem install json -v '1.7.7'
Building native extensions.  This could take a while...

ERROR:  Error installing json:
  ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h


Gem files will remain installed in /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7 for inspection.
Results logged to /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out

誰もそれを見たことがありますか?

4

1 に答える 1

1

Fedora「rpm」システム (またはRed Hat) を使用している場合は、次を使用します。

sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel

それは私にとって問題を解決しました。

于 2013-04-09T01:06:57.287 に答える