Heroku: Push rejected, failed to compile Ruby app

前端 未结 3 1057
梦谈多话
梦谈多话 2021-01-26 18:07

I have been stuck for a week trying to figure this out. I have currently been following online lectures, however I followed everything exactly, and the instructor isn\'t really

相关标签:
3条回答
  • 2021-01-26 18:25

    You can't use SQLite on Heroku, you'll have to use PostgreSQL.

    You can set it up to use PostgreSQL on Heroku but SQLite in development, it's a good practice to use the same database in both your development and production environments.

    Notice that you list the gem 'sqlite3' multiple times, including one outside the development group. This causes Heroku to try to install it.

    My suggestion is to remove the sqlite gem completely and switch all to PostgreSQL.

    0 讨论(0)
  • 2021-01-26 18:34

    I would recommend a few things:

    1) Follow the instructions here to deal with the Gemfile issues that arise when deploying a Ruby project generated on Windows.

    2) Do the following in your Gemfile

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

    This gets rid of sqlite3 from your production deployment. Use it for unit and integration testing, but use PostgreSQL for acceptance/functional testing because that's the RDBMS of choice on Heroku. Also, reference your gems only once each.

    3) Set up the Hobby Dev version of the PostgreSQL add-on in your deployment environment on Heroku.

    0 讨论(0)
  • 2021-01-26 18:36

    remove the top gem sqlite3 and add ruby '2.0.0' at the top of your gemfile

    also under the group production add gem 'rails_12factor'

    0 讨论(0)
提交回复
热议问题