4

For a Rails 3.1 app, I want to develop locally using SQLite and deploy to Heroku (which requires PostgreSQL).

I've set up my gemfile with

group :development, :test do
  gem 'sqlite3'
end

I can push to Heroku successfully but the app fails with

"Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)"

If I add the pg gem to my Gemfile and run bundle install, I get:

"ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)     /opt/local/bin/ruby extconf.rb checking for pg_config . . . not found"

because I don't have PostgreSQL installed locally.

I don't want to install PostgreSQL locally.

Is there a way to deploy to Heroku without installing PostgreSQL locally?

1
  • Good advice in general but in this case I'm doing something very simple and it doesn't merit cluttering my development machine with an unused package. Commented Dec 21, 2011 at 18:30

2 Answers 2

7
bundle install --without production

should do the trick. See docs for further information.

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

Comments

2

This walks you through deploying a 3.1 app to heroku, since you already have your app built, skip to the deployment part of the video. Your issue is encountered @9.50 in the video

http://www.youtube.com/watch?v=p_3dIPgXgkg

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.