views:

405

answers:

2

I am a novice linux user trying to come to terms with *nix development using Ruby on Rails. I am reading an excellent book titled "Simply Rails 2" [SitePoint:lenz] and haven't had any problem until I try to create a new Story object within the rails console and I get a "no driver for sqlite3 found" error:

$sudo ruby script/console Loading development environment (Rails 2.3.2)

class Story < ActiveRecord::Base end => nil story = Story.new RuntimeError: no driver for sqlite3 found from /usr/local/lib/ruby/gems/1.9.0/gems/sqlite3-ruby-1.2.4/lib/sqlite3/database.rb:621 :in 'load_driver'...

I think it may have someting to do with where I installed the Ruby components.
I installed these folders on my desktop:

ruby-1.9.0-5 rubygems-1.3.1 sqlite-3.6.11

I'm pretty sure this is a configuration/installation issue but I'm so lost when it comes to Linux and would so appreciate any help.

A: 

I can only recommend to install gem via your distribution package manager (aptitude/apt-get on Debian, yum on Fedora, ...) and then install everything via gem itself.

gem install rails

This should include the sqlite driver.

Lennart
rails and sqlite are installed already. I think it's due to there being multiple versions of rails and/or sqlite.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games. I'm wondering if I shouldn't move the sqlite-3.6.11 and/or rubygems-1.3.1 and/or ruby-1.9.0-5 folders to /usr/local/bin. can I just move them there? I'm sure they don't belong on the desktop.
+1  A: 

Try:

gem install sqlite3-ruby
klew