heroku push rejected, failed to compile Ruby/rails app

巧了我就是萌 提交于 2019-12-29 03:15:05

问题


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 would just use a custom domain with heroku...... No this isnt a test app "learning rails" thing, actual app i want to deploy for use within the business I own, any help would be great, I have searched and havent seen a solution to this problem.

Make sure 'gem install sqlite3 -v 1.3.7' succeeds before bundling.

Failed to install gems via Bundler

Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:peaceful-chamber-6371.git
[remote rejected] master -> master <pre-receive hook declined>
error: failed to push some refs to 'git@heroku.com:peaceful-chamber-6371.git

Gem File

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
end
group :production do
  gem 'pg'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'twitter-bootstrap-rails'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

回答1:


try this,

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




回答2:


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



回答3:


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.




回答4:


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




回答5:


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.




回答6:


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



来源:https://stackoverflow.com/questions/15737296/heroku-push-rejected-failed-to-compile-ruby-rails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!