Chris Dellinger
Chris Dellinger

Reputation: 2362

Sqlite on a production box

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.

Upvotes: 1

Views: 340

Answers (1)

Simone Carletti
Simone Carletti

Reputation: 176412

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.

Upvotes: 2

Related Questions