Impossible to deploy app in heroku - it searches ruby 2.0.0p195 - ruby-on-rails

I've deploying our app with rails 3.2.13 and ruby 2.0.0p0 without problems in heroku. However, today suddenly I couldn't deploy it. This is the log, it seems the only difference in our project is the version of ruby 2.0.0, which is trying to be installed:
Counting objects: 42, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (25/25), 3.17 KiB, done.
Total 25 (delta 19), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Ruby version change detected. Clearing bundler cache.
Old: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
New: ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
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 money-rails-0.8.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
It seems that it cannot find the money-rails gem (version 0.8.0), but in localhost is working perfectly, and also until yesterday in heroku. I think it's has to be with the new ruby version as it's the only visible change regarding the gems...
Anyone with the same problem?
Thanks in advance!!

You may not have changed anything but it appears the author of money-rails has yanked 0.8.0 and replaced it with 0.8.1. See http://rubygems.org/gems/money-rails for details.
You would have to do a bundle update and commit Gemfile.lock and redeploy and all should be good.

Related

Deploy to dokku fails because of ruby-buildpack + bundler?

I'm deploying a rails app to dokku. The Versions are:
ruby 3.1.2
bundler 2.3.26 (on my development machine)
gem 3.3.22 (on my development machine)
when i try to deploy to dokku, the heroku ruby buildpack is used, and I get
the following output:
-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
[330, #<Thread:0x00007fc0e8b43c90 run>, #<NameError: uninitialized constant Gem::Source
(defined?(#source) && #source) || Gem::Source::Installed.new
^
The crazy thing: I have another app with the same configuration where it works:
-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
Fetching gem metadata from https://rubygems.org/.........
My research so far:
This seems to be the problem described here as an issue with bundler 2.3.7 first described in February 2022. But my buildpack uses bundler 2.2.21, so it should not be affected?
The newest ruby-buildpack from heroku seems to have been released in 2021?
Can this be right?
This fixed the problem for one app:
upgrade to ruby 3.1.3 (by editing ruby version in Gemfile and in .ruby-version)
bundle install
bundle lock --add-platform x86_64-linux
After one successfull install I could also roll back to the old ruby version, before upgrade, and successfully install that.
How? Why? What is going on here?
Now another app that used to work stopped working.
Purging the dokku build cache fixed the problem:
dokku repo:purge-cache
correction: this helped for some applications, not for all

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

Downgrade/Revert Ruby Version on Heroku

I recently updated my Heroku app from Ruby 2.3.1 to 2.4.0, but I now need to revert back to version 2.3.1.
To Update:
I changed the version in the Gemfile from 2.3.1 to 2.4.0. Everything went fine, but I need to go back to 2.3.1 because of problems specific to me with 2.4.0
To Revert:
I've tried changing the version back to 2.3.1 in my Gemfile (as ruby "2.3.1") but it just throws the bundler error Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
How do I change my Ruby version back to 2.3.1 on Heroku?
Here is the error on deployment:
ID yupp
-----> heroku-buildpack-rgeo-prep app detected
-----> Removing cached .bundle/config
Writing new .bundle/config
-----> VendorBinaries app detected
-----> Found a .vendor_urls file
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.4.0
###### WARNING:
You have the `.bundle/config` file checked into your repository
It contains local state like the location of the installed bundle
as well as configured git local gems, and other settings that should
not be shared between multiple checkouts of a single repo. Please
remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
https://devcenter.heroku.com/articles/bundler-configuration
-----> Installing dependencies using bundler 1.13.7
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
Bundler Output: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby version is 2.4.0, but your Gemfile specified 2.3.1
!
! Failed to install gems via Bundler.
! Detected a mismatch between your Ruby version installed and
! Ruby version specified in Gemfile or Gemfile.lock:
! https://devcenter.heroku.com/articles/ruby-versions#your-ruby-version-is-x-but-your-gemfile-specified-y
!
! Push rejected, failed to compile Ruby app.
! Push failed
I figured it out. Here are the steps
Locally:
Change the Ruby version from 2.4.0 to 2.3.1
Verify the version is 2.3.1 with ruby -v
Run gem install bundler && gem install rails
Run bundle install
Commit the Gemfile and Gemfile.lock and push to Heroku

Am having trouble in git push heroku master am getting the error below

rakesh#rakesh:~/rails/sapwii$ git push heroku master
Fetching repository, done.
Counting objects: 29, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 58.09 KiB, done.
Total 19 (delta 15), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Ruby version change detected. Clearing bundler cache.
Old: ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
New: ruby 2.0.0p576 (2014-09-19 revision 47628) [x86_64-linux]
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/........
Could not find activemerchant-1.43.2 in any of the sources
Bundler Output: Fetching gem metadata from https://rubygems.org/........
Could not find activemerchant-1.43.2 in any of the sources
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:sapwii.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:sapwii.git'
I tried changing the SSH Keys and on heroku, getting this error only when pushing my core repository is fine to commit and clone
From the error above, the error is caused by the active merchant version. If you look at the list of available versions for active merchant, you'll see that version 1.43.2 is not there. So either you upgrade or downgrade the version. Check out your Gemfile and make sure that the version activemerchant is locked to exists.
If you didn't lock the activemerchant version in your Gemfile, just run bundle update activemerchant and that will fix your issue.

Foundation 5 for Rails on Heroku Failing

I am building a new website on Rails and was able to successfully install the new Foundation 5 gem locally. When I pushed it to Heroku I have been getting the following message:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
New app detected loading default bundler cache
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 foundation-rails-5.0.0 in any of the sources
Bundler Output: Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Could not find foundation-rails-5.0.0 in any of the sources
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
Any ideas where I should go from here? Is there something I need to do on my end or is this on Heroku's end?
The first few versions of the gem were yanked.
Make sure your Gemfile points to a version 5.0.1.0 or greater.
I've had the same issue, and it's also been noted on Foundation's forum. The foundation-rails gem is pretty new (I just now updated to 5.0.2) and it still tanks. Probably just a matter of time until Heroku/Zurb work out the kinks.

Resources