Renan
Renan

Reputation: 1990

Rails doesn't see my sqlite3

I've recently changed computers (Mac with OS 10.6.7) and I'm trying to launch my RoR application. It didn't work because apparently sqlite3 was missing. I've tried updating it using

gem install sqlite3

but it doesn't work and the following error is issued:

Error installing sqlite3:
ERROR: Failed to build gem native extension.

But the thing is, I can use the sqlite3 command on the terminal, which launches perfectly, announcing a 3.6.23.1 version. Why can't rails see it? It is indeed not installed as a gem, is that why? Suggestions on how to solve this issue? Thanks.

P.S.: I've tried doing

port install sqlite3

but it doesn't work either because:

Error: Cannot install sqlite3 for the arch(s) 'x86_64' because
Error: its dependency readline is only installed for the arch 'i386'
Error: and the configured universal_archs 'i386 ppc' are not sufficient.
Error: Unable to execute port: architecture mismatch

Upvotes: 0

Views: 278

Answers (2)

theIV
theIV

Reputation: 25774

Was this system upgraded from 10.5 to 10.6? That error message that you are getting when trying to run port install sqlite3 sounds like a number of errors that I received when I had done an upgrade and not a clean install.

My guess: you need to build a new version of readline (64-bit, your current one appears to be 32-bit) and then build a new version of sqlite3. I have no idea how many other dependencies you have on readline (probably quite a few) so this could be a little bit of a lengthy process.

This really isn't my forte, but I went through a bunch of similar issues during my upgrade, as I said, and this is how I resolved most of them.

Upvotes: 1

Jeremy B.
Jeremy B.

Reputation: 9216

Having the sqlite gem and sqlite is not the same thing. You've got the database, but you need the gem installed to allow ruby to access your sqlite db.

The gems you should have are

sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)

Try installing gem sqlite3-ruby it should auto grab the right dependency. I've also seen that error if permissions are not correct, you may need to run the command as sudo.

Upvotes: 0

Related Questions