heroku push rejected, failed to compile Ruby/rails app

前端 未结 6 1161
醉酒成梦
醉酒成梦 2020-12-13 10:23

Having the following issue, BRAND NEW TO RoR, first time ever trying to upload an app to go live, first had hosting issues, then decided if i could fix them with heroku i wo

相关标签:
6条回答
  • 2020-12-13 11:00

    Although the question has an accepted answer, the answer did not help me, I had the same problem. The following worked for me, hence contributing. Heroku does not support sqlite 3. In this case, I had sqlite3 gem in my gemfile, which you are supposed to put in development group, and put postgres gem (which heroku supports) in production group.

    1) Delete the gemfile.lock file (from your project folder)

    2) In the gemfile, remove gem sqlite3 or similar sqlite3 gem

    3) Instead of that add following to the end of file:

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

    Now, run the following commands in terminal:

    bundle install
    git add .
    git commit
    git push
    git push heroku master
    

    Although it was a silly mistake, It took me time to realize the same. Hope it helps someone.

    0 讨论(0)
  • 2020-12-13 11:16

    Heroku does not like sqlite3, change gem 'sqlite3' with gem 'pg'

    0 讨论(0)
  • 2020-12-13 11:17

    try this,

    remove Gemfile.lock file and do bundle install , then git add, git commit and git push .

    0 讨论(0)
  • 2020-12-13 11:22

    Look though the all of the output that Heroku writes to the console -- your error is likely to be there somewhere. I ran into this and found that the precompile step had failed. That can be run locally as well:

    rake assets:precompile
    
    0 讨论(0)
  • 2020-12-13 11:25

    My issue was that I had my bower directory ignored in .gitignore.

    So I either need to do bower install from my packages.json or check in my bower dir.

    http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

    I chose to check in my bower dir for a quick solution right now.

    0 讨论(0)
  • 2020-12-13 11:26

    Heroku's asset plugins no longer work since Rails 4 does not support plugins. You need to use Heroku's asset gems instead. Place this in your Gemfile:

    group :production do
      gem 'rails_12factor'
    end
    

    Answer found here: Heroku does NOT compile files under assets pipelines in Rails 4 worked for me

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