[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Sqlite3 error on Mac OS X

Dan Munk

1/30/2006 5:53:00 AM

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

4 Answers

Hans Fugal

1/30/2006 2:16:00 PM

0

Is the problem in your database.yml file?

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

Dan Munk

1/31/2006 4:44:00 PM

0

That was my problem, thanks for your help.

Jamis Buck

2/1/2006 10:22:00 PM

0

On Feb 1, 2006, at 2:38 PM, Dan Munk wrote:

> 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

>
> 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
>
>



Marius Friis

2/1/2006 10:24:00 PM

0

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
On 1. feb. 2006, at 22.38, Dan Munk wrote:

> 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
>
>

--
Marius Friis
mariusfriis@mac.com