Error setting up Ruby on Rails
Following this guide, I'm attempting to set up Ruby on Rails using Amazon's EC2. For my instance I've selected "Basic 32-bit Amazon Linux AMI 2010.11.1 Beta". I have ruby, sqlite, and rubygems installed. I'm on step 3.3 of the linked guide which is to run the following command
bundle install
The result is the following. I'm sure I've just missed something, but I'm at a loss. Any suggestions?
Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems /installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-1.3.3 for inspection.
EDIT: Following the suggestion below to install ruby-devel, I now get this error in addition to the original one.
Installing sqlite3 (1.3.3) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions':
ERROR: Failed to build gem native extension. (Gem::Installer::Exte开发者_如何学PythonnsionBuildError)
/usr/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite3-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
But when I try to run
yum install sqlite-devel
I'm told:
Package sqlite-devel-3.6.20-1.6.amzn1.i386 already installed and latest version
Nothing to do
In addition to the packages above, mas sure you have gcc and make installed.
They are needed to build the gems you are installing in addition to the development libraries.
Try to install the libsqlite3-dev before
$ sudo apt-get install libsqlite3-dev
and retry to install the gem after
$ gem install sqlite3-ruby
This worked for me:
yum install ruby-devel
yum install sqlite-devel
NOT sqlite3-devel
Venturing a guess here, but you might be missing a few development packages. Try running:
yum install ruby-devel sqlite3-devel
精彩评论