Your Gemfile lists the gem more than once. could cause errors
heroku, postgresql, ruby, ruby-on-rails, sqlite
Solution
You are repeating putting sqlite in the development group here:
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
gem 'guard-rspec', '0.5.5'
end
group :development do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
end
You can delete your second development group listing here as it adds nothing - you've already put them in development and test in the first statement. Similarly by putting pg outside of any group it's available in all, so adding it to production is a duplicate listing.
A rewrite of your gemfile COULD be:
gem 'rails', '3.2.11'
gem "bootstrap-sass"
gem 'will_paginate'
gem 'bootstrap-will_paginate', '0.0.6'
# gem 'pg', '0.12.2'
gem 'pg_search'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
end
group :test do
gem 'guard-rspec', '0.5.5'
end
group :production do
gem 'pg', '0.12.2'
gem 'rack-google_analytics'
end
Also, one friendly tip from someone who's felt the pain: try to use the same db in development as production. I know it can be tricky to get postgres set up locally at first but once it's there it's rock solid and very easy to use. You will risk far fewer bugs due to differences (for example with searching text within fields iirc) between PG and SQLite implementations.
With no sqlite:
gem 'rails', '3.2.11'
gem "bootstrap-sass"
gem 'will_paginate'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'pg', '0.12.2'
gem 'pg_search'
group :development, :test do
gem 'rspec-rails', '2.10.0'
end
group :test do
gem 'guard-rspec', '0.5.5'
end
group :production do
gem 'rack-google_analytics'
end
Problem
I am currently getting these messages below when i run bundle install ``` Your Gemfile lists the gem sqlite3 (= 1.3.5) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later. Your Gemfile lists the gem rspec-rails (= 2.10.0) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later. Your Gemfile lists the gem rspec-rails (= 2.10.0) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later. Your Gemfile lists the gem pg (= 0.12.2) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later. ``` I am using Postgresql with Heroku and I believe I am using Postgresql in both my development and testing. I recently migrated/switched from sqlite to postgresql. Do I still need the sqlite3 gems in :development or in :development, :test ? And lastly, is there a difference between :development & :development, :test ? database.yml ``` development: adapter: postgresql encoding: unicode database: xxxxxx_development pool: 5 username: xxxxxx password: test: adapter: postgresql encoding: unicode database: xxxxxx_development pool: 5 username: xxxxxx password: ``` Gemfile ``` gem 'rails', '3.2.11' gem "bootstrap-sass" gem 'will_paginate' gem 'bootstrap-will_paginate', '0.0.6' gem 'pg', '0.12.2' gem 'pg_search' group :development, :test do gem 'sqlite3', '1.3.5' gem 'rspec-rails', '2.10.0' gem 'guard-rspec', '0.5.5' end group :development do gem 'sqlite3', '1.3.5' gem 'rspec-rails', '2.10.0' end # Test gems on Macintosh OS X group :test do gem 'rspec-rails', '2.10.0' end group :production do gem 'pg', '0.12.2' gem 'rack-google_analytics' end ```