heroku push code error ruby on rails mac os [duplicate] - ruby-on-rails

This question already has answers here:
Failed to install gems via Bundler. remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote:
(2 answers)
Closed 7 years ago.
This is my output at mac terminal and heroku master branch:
[remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/projectname.git'
In heroku
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.9.7
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* ruby (= 2.0.0)
* pg (= 0.17.1)
Bundler Output: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* ruby (= 2.0.0)
* pg (= 0.17.1)
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app

You will probably need to do bundle install first, so that your gem.lock file is up to date before pushing to heroku.....

Related

Deployment failed on heroku - Ruby on Rails

Im having a problem to deploy a new version of my Ruby on Rails app on heroku.
Heroku build log:
-----> Ruby app detected
-----> Installing bundler 2.0.2
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.6
Ruby version change detected. Clearing bundler cache.
Old: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
New:
-----> Installing dependencies using bundler 2.0.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
/usr/bin/env: ‘bash’: Argument list too long
Bundler Output: /usr/bin/env: ‘bash’: Argument list too long
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app.
! Push failed
Important notes:
I haven't changed the Ruby version;
I've tryed to deploy another Ruby on Rails app, and realize that i'm not able to deploy any Ruby on Rails app.
Anyone with the same problem or any idea to help?
Apparently, the problem is related to a buildpack version released at July, 13. I solved the issue removing this update and specifying the version of Ruby buildpack
$ heroku buildpacks:remove heroku/ruby
and then
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby#v217

Pushing Rails to Heroku, can't find Rake taks

UPDATE: now using Ruby 2.5.5 and Bundler 2.0.2, still getting the error:
/app/tmp/buildpacks/<long hash>/lib/language_pack/helpers/rake_runner.rb:106:
in load_rake_tasks!':
Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)`
I'm trying to git push heroku master a Rails app for the first time, and I'm getting this error:
remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! Activating bundler (2.0.1) failed:
remote: ! Could not find 'bundler' (2.0.1) required by your /tmp/build_cf9981ccbdc1fd4f0b82703a5ff40ecc/Gemfile.lock.
remote: ! To update to the latest version installed on your system, run `bundle update --bundler`.
remote: ! To install the missing version, run `gem install bundler:2.0.1`
remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
remote: !
remote: ! To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`
remote: !
remote: /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: Activating bundler (2.0.1) failed:
remote: Could not find 'bundler' (2.0.1) required by your /tmp/build_cf9981ccbdc1fd4f0b82703a5ff40ecc/Gemfile.lock.
remote: To update to the latest version installed on your system, run `bundle update --bundler`.
remote: To install the missing version, run `gem install bundler:2.0.1`
remote: Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
remote:
remote: To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`
I have run gem install bundler:2.0.1 successfully in this app's root directory. My $GEM_PATH does not include vendor/bundle/ruby/2, and I don't know if altering it is the solution. If so, does that mean I need to alter it locally or remotely? If locally, is it done the same way as normal environment variables, or is there a special Rails setting I need to change?
I have tried the suggestion in the accepted answer here:
heroku push error: "Could not detect rake tasks"
but that made no difference.
My problem also seems to be similar to the (unanswered) question here:
Can't Push Rails Project to Heroku
Searching the Heroku Help Center didn't seem to yield any results, either.
Any guidance about what I should do?
This is a known issue with Bundler 2 on Heroku:
A Gemfile.lock that specifies bundler 2.0.2 does not work with bundler 2.0.1
If you attempt to deploy an app that uses bundler 2.0.2 onto the Heroku platform with bundler 2.0.1 you may get this error:
`find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
This is due to a bug in the Rubygems bundler version checking code. To avoid this issue, upgrade your Ruby version. It is fixed in 2.5.5+ and 2.6.3+. If you do not update, your Ruby version then every new release of Bundler 2.x will trigger this issue.
Upgrade Ruby to version 2.5.5+ or 2.6.3+ locally, update your Gemfile accordingly, and re-run bundle. Commit the changes to your Gemfile and Gemfile.lock, then deploy again.

Errors with "git push heroic master", what to do?

So i'm trying to deploy my rails app through heroku. But every time i run "git push heroic master", i run into this. I have searched around, but nothing seems to work. I have tried to "bundle update", "bundle install", but i still get this error when i run "git push heroic master"
Counting objects: 84, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (84/84), 20.65 KiB | 1.88 MiB/s, done.
Total 84 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote: The dependencies in your gemfile changed
remote: You have added to the Gemfile:
remote: * pg
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: The dependencies in your gemfile changed
remote:
remote: You have added to the Gemfile:
remote: * pg
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to secret-mesa-55611.
remote:
To https://git.heroku.com/******
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*******.git'
It seems that your Gemfile.lock is changed. Try running bundle install after cleaning the Gemfile.lock

I can't push my Rails project to heroku, can't find bootstrap-sass

When I try to push my project to Heroku I get this error:
-----> Deleting 3 files matching .slugignore patterns.
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Could not find bootstrap-sass-2.3.1.1 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:kerbal-space-station.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:kerbal-space-station.git'
However my Gemfile certainly does have that and bundle install locally works fine.
bootstrap-sass 2.3.1.1 was yanked: https://rubygems.org/gems/bootstrap-sass/versions
You should run:
bundle update bootstrap-sass
then commit the new Gemfile.lock and push to heroku
The last version of bootstrap-sass is 2.3.1.0, you're looking for 2.3.1.1 and it doesn't exists.
Check your gemfile and add:
gem 'bootstrap-sass', '2.3.1.0'
you don't need to put version number you can only put
gem 'bootstrap-sass'
then do
bundle update

Error in Gemfile with heroku deploy

I'm reading this manual and when I try to deploy my first app git says:
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
Windows Gemfile.lock detected, ignoring it.
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* source: rubygems repository http://rubygems.org/
* rails (= 3.0.3)
* sqlite3 (= 1.3.3)
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
To git#heroku.com:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
Any solution?
Unfortunately, you can't deploy to Heroku very well from a Windows Rails installation.
It is telling you that you didn't commit the file right after saying it ignored the file, so the real question you're trying to answer is "why isn't Heroku accepting my Windows Gemfile.lock file?". Based on that, I'd have pulled out "Windows Gemfile.lock detected; ignoring it" and pasted that into google or here in Stack Overflow.
That would have lead you to this previous SO answer: Why won't Heroku accept my Gemfile.lock in Windows?

Resources