0

When I try to run the

bundle install --without production

command on Ubuntu 12.04, I get an error message like this:

Could not find gem 'pg0.12.2 (>= 0) ruby' in the gems available on this machine

Any ideas about why this is happening? Thanks

Nathan Dunn
  • 336
  • 2
  • 3
  • 12

1 Answers1

2

If you want 0.12.2 gem to be installed please write in the following way.

gem 'pg', '0.12.2'

If you want version which is greater than 0.12.2 then write in following way

gem 'pg' , '>= 0.12.2'

Please use this link to know more about how to bundle gems in rails Bundle

Shreyas Agarwal
  • 1,128
  • 8
  • 10
  • When I typed: `gem install 'pg', '0.12.2'` it is saying: `Could not find a valid gem '0.12.2' (>= 0) in any repository` – Nathan Dunn Aug 13 '12 at 10:42
  • Could you please post your complete bundle file here? – Shreyas Agarwal Aug 13 '12 at 10:44
  • http://stackoverflow.com/questions/6040583/unable-to-install-pg-gem-on-ubuntu Hope this helps – Shreyas Agarwal Aug 13 '12 at 10:46
  • You dont need to have gem install 'pg' , '0.12.2'. Just doing gem install 'pg' will install the gem with the lastest version i.e. 0.14.0. If you want to install version 0.12.2 then please use -v options while installing `gem install pg -v 0.12.2` – Shreyas Agarwal Aug 13 '12 at 10:50
  • still getting the `Could not find gem 'pg0.12.2 (>= 0) ruby' in the gems available on this machine.` error – Nathan Dunn Aug 13 '12 at 11:00
  • Just follow the steps 1) Open terminal 2) Just write `gem install pg -v 0.12.2` 3) If still getting error then please paste it here – Shreyas Agarwal Aug 13 '12 at 11:04
  • here is my gemfile: `source 'https://rubygems.org' gem 'rails', '3.2.7' group :development do gem 'sqlite3', '3.2.8' end group :assets do gem 'sass-rails', '~> 3.2.4' gem 'coffee-rails', '~> 3.2.2' gem 'uglifier', '>= 1.2.3' end gem 'jquery-rails', '2.0.2' group :product do gem 'pg' '0.14.0' end` – Nathan Dunn Aug 13 '12 at 11:06
  • 1
    Please add , between gem 'pg' and '0.14.0 it should be `gem 'pg' , '0.14.0'` – Shreyas Agarwal Aug 13 '12 at 11:08