I have these groups in my Gemfile:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'mysql'
end
The development machine does not have MySQL installed, which is why I have only listed MySQL in the production group. But when I try to run Rails on the development machine I get this:
$> RAILS_ENV=development ./script/rails
Could not find gem 'mysql (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
Obviously I could fix this by installing MySQL, but I would like to know the correct solution instead of installing unneeded software.
You do need to have the gem installed. Bundler (the underlying gem manager for Rails) requires it so you can resolve potential conflicts of dependencies in development rather than finding out you have gem conflicts when you roll to production. Yehuda (builder of Bundler) wrote a blog post on it, look in the section titled "Consistency".
http://yehudakatz.com/2010/05/09/the-how-and-why-of-bundler-groups/
did you rerun "bundle install" after changing your Gemfile?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With