views:

42

answers:

1

Should I have to install sqlite on a prod box where I'm using mysql for a rails application? The reason I ask is that phusion is yelling at me with the following error:

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

My gemfile has the following

group :development, :test do
    gem 'sqlite3-ruby', :require => 'sqlite3'
end

group :production do
    gem 'mysql'
end

If I comment out the entry under the development section my problem goes away. I'm guessing I could also install sqlite on the prod server but for some reason that seems wrong to me. I was assuming that having the reference in the :development section would prevent this from happening, but that obviously does not appear to be the case.

Any suggestions of best practice for this scenario? I'd be especially interested if you see that I am doing something wrong.

+2  A: 

When you run bundler install, by default bundler will try to resolve and install the Gems for all the environments.

If you want to skip a specific environment, you can pass the --without parameter.

$ bundler install --without development
$ bundler install --without test development

Also, remember to use the --deployment flag.

Simone Carletti
hmm, that makes sense if I was running it from the command line on my prod server, so I'm guessing I'll need to configure phusion passenger to do this as well, is that possible?
Chris Dellinger
No, you need to make sure you loaded the right environment. For instance, to open a console in production mode use `rails c production` (for Rails 3) or `script/console production` (for Rails 2)
Simone Carletti