0

http://totutotu.hatenablog.com/entry/2015/08/30/Amazon_LinuxにRails用の環境構築
上記サイトを参考にrails環境を構築していますが、途中でエラーのなってしまいます。
nokogiriをインストールするとの記述ですが、インストールでエラーになってしまいます、どこの修正が必要になりますか?

# gem install nokogiri -- --use-system-libraries

Fetching: mini_portile2-2.0.0.gem (100%)
Successfully installed mini_portile2-2.0.0
Fetching: nokogiri-1.6.7.2.gem (100%)
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

current directory: /usr/local/share/ruby/gems/2.0/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/bin/ruby2.0 -r ./siteconf20160211-17517-htr7sm.rb extconf.rb --use-system-libraries
mkmf.rb can't find header files for ruby at /usr/share/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /usr/local/share/ruby/gems/2.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /usr/local/lib64/ruby/gems/2.0/gems/nokogiri-1.6.7.2/gem_make.out

# gem install --no-ri --no-rdoc rails

Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: concurrent-ruby-1.0.0.gem (100%)
Successfully installed concurrent-ruby-1.0.0
Fetching: sprockets-3.5.2.gem (100%)
Successfully installed sprockets-3.5.2
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.8.4.gem (100%)
Successfully installed minitest-5.8.4
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: activesupport-4.2.5.1.gem (100%)
Successfully installed activesupport-4.2.5.1
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

current directory: /usr/local/share/ruby/gems/2.0/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/bin/ruby2.0 -r ./siteconf20160211-17550-1i040vi.rb extconf.rb
mkmf.rb can't find header files for ruby at     /usr/share/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in     /usr/local/share/ruby/gems/2.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /usr/local/lib64/ruby/gems/2.0/gems/nokogiri-1.6.7.2/gem_make.out

1 件の回答 1

1
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd

で最初にLAMPを構築すると、rubyのバージョンが2.0.0なので、

rbenv global 2.2.2

で切り替え、再度インストールすると、できました。

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。