Friday, December 4, 2009

Ubuntu: Problem during "gem install" - /usr/bin/ruby1.8 extconf.rb

If you get this when installing sqlite3-ruby:
biju@ubhome:~$ sudo gem install sqlite3-ruby
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
 ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
 from extconf.rb:1


Gem files will remain installed in /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5 for inspection.
Results logged to /var/lib/gems/1.8/gems/sqlite3-ruby-1.2.5/ext/sqlite3_api/gem_make.out

Then solution gleaned from Google is to run:
biju@ubhome:~$ sudo apt-get install ruby1.8-dev

If it says:
biju@ubhome:~/notes$ sudo gem install sqlite3-ruby
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
 ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for fdatasync() in -lrt... yes
checking for sqlite3.h... no

Then solution is to run:
biju@ubhome:~/notes$ sudo apt-get install libsqlite3-dev

"sudo gem install sqlite3-ruby" should just run with these libraries in place.

If you see the following while starting the rails application:
./script/../config/../vendor/rails/railties/lib/initializer.rb:259:in `require_frameworks': no such file to load -- openssl (RuntimeError)
 from ./script/../config/../vendor/rails/railties/lib/initializer.rb:133:in `process'
 from ./script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `send'
 from ./script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `run'

then run:
sudo apt-get install libopenssl-ruby

No comments:

Post a Comment