3

I have cloned the git repository of my rails project after reinstalling the Linux Mint. When I am running the bundle install I am getting the following error.

Rails version : 3.2.8

ruby version: 1.9.3p0

An error occurred while installing pg (0.12.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.12.2'` succeeds before bundling.

Here is my gem file :

source 'https://rubygems.org'
gem 'rails', '3.2.3'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
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'
group :test do
gem 'capybara', '1.1.2'
end
group :production do
gem 'pg', '0.12.2'
end
1
  • 1
    pg is probably trying to install a native (C/C++) extension and fails to compile. Make sure you have the postgresql dev packages installed on your Linux distro. Commented Oct 28, 2012 at 6:40

1 Answer 1

3

You can run bundle install --without production which will install all the relevant gems BUT the ones for production. Since you have sqlite configured there, it won't install the postgres gem.

However, if you do want to install all of the gems, you might going to have to install postgresql first: sudo apt-get install postgresql

If this doesn't work, try to run gem install pg -v '0.12.2' and post the error log.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.