Sqlite3 error on Mac OS X

D

Dan Munk

Hi,

I am having problems with sqlite connectivy. When I use the require
command with 'SQLite3' everything works fine. The problem is that
active record uses 'sqlite'. I was hoping to get some advice on the
best way to get everything in sync.

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'SQLite3'
=> true
irb(main):003:0> require 'sqlite'
LoadError: no such file to load -- sqlite
from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'
from
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
from (irb):3
irb(main):004:0>

Thanks,
Dan
 
H

Hans Fugal

Is the problem in your database.yml file?

development:
adapter: sqlite3
dbfile: db/dev.db
 
J

Jamis Buck

Hi,

I am having problems with sqlite connectivy. When I use the require
command with 'SQLite3' everything works fine. The problem is that
active record uses 'sqlite'. I was hoping to get some advice on the
best way to get everything in sync.

Note that 'sqlite' and 'sqlite3' are distinct. require 'sqlite' tries
to bring in the Sqlite 2.x bindings. Try doing "gem install sqlite-
ruby" and then just do "require 'sqlite'" and you should be good.

That, or configure AR to use sqlite3 instead of sqlite:

adapter: sqlite3

- Jamis
 
M

Marius Friis

Did you install it using rubygems?
Had a similar problem after installing it with a gem, couldnt get it
working. In the end i
downloaded the source and compiled it myself, worked fine after that.
seems to be some
sort of gem issue on os x or some such.

- Marius
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top