Heroku error when launch rails3.1 app missing postgres gem

前端 未结 3 483
野的像风
野的像风 2020-12-16 15:02

I am trying to deploy to heroku.

Rails 3.1.0.rc4,

I get the following error from Heroku logs:

Starting process with command: `thin -p 48902          


        
相关标签:
3条回答
  • 2020-12-16 15:23

    I found a solution in this Heroku article.

    As Jared said, they suggest to create a different group for postgresql.

    0 讨论(0)
  • 2020-12-16 15:28

    You don't have to install Postgres locally. In your Gemfile, put 'pg' in group :production, as johnny-grass suggests, and then when you run bundle, just specify --without production, like this:

    bundle --without production
    

    Unfortunately, you have to remember this argument when you run bundler, but at least you don't have to install and maintain postgres locally.

    Please note that Heroku "strongly recommends against" using sqlite, saying that "Your production and development environment should be as close to identical as possible" http://devcenter.heroku.com/articles/rails3

    0 讨论(0)
  • 2020-12-16 15:37

    Do you have PostgreSQL installed on your computer? If you don't then install it first, then install the pg gem.

    # gemfile
    group :production do
      gem 'therubyracer-heroku', '0.8.1.pre3' # you will need this too
      gem 'pg'
    end
    
    0 讨论(0)
提交回复
热议问题