Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 can not find sqlite3-ruby

I am trying to learn rails3.

I tried folowing the installation guide from guides.rails.info, I installed

sudo gem install rake rack-test rack-mount erubis mail
sudo gem install tzinfo builder i18n memcache-client
sudo gem install text-format thor

And rails 3 via

sudo gem install rails --pre

Now I create a new app

rails abc

And try

rake db:create

Which fails with

Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the sources.

So I try installing sqlite3-ruby

sudo gem install sqlite3-ruby

Which fails with

Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

So I install it via apt-get

sudo aptitude install libsqlite3-ruby1.8.

And still get same error on rake db:create.

like image 882
agiliq Avatar asked Feb 21 '10 12:02

agiliq


1 Answers

This can be caused by a number of things. So I have a number of questions too. ;)

Is this Debian or Ubuntu? I'm going to assume Ubuntu.

I also assume, because you tried installing libsqlite3-ruby1.8, that you are also running Ruby 1.8? Do you have any other versions of Ruby installed? And what does ruby --version say?

Ubuntu versions it's Ruby packages as ruby1.8, ruby1.9.0, and ruby1.9.1. Look for those in your package manager. The package named just ruby is a dummy that depends on whatever is the default version for Ubuntu at that time.

When you start irb and do require 'sqlite3', what is the output?

As for the gem install not working, if you want to try that again, do you have the ruby-dev and libsqlite3-dev Ubuntu packages installed?

like image 137
Stéphan Kochen Avatar answered Oct 21 '22 11:10

Stéphan Kochen