Open bprobst-msis opened 2 years ago
Hi @bprobst-msis - thanks for the report and apologies for the issue. The heroku deploy file hasn't been updated in a while. I'll see if I can resurrect it soon.
This may be a Heroku issue as the app.json
file for these Heroku deploys hasn't changed in quite a while. See linked issue above.
After specifying a specific stack to build with by adding "stack": "heroku-20",
to app.json
and also when attempting to update my current instance I am getting the following build error:
Running: rake assets:precompile rake aborted! LoadError: Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile. Caused by: Gem::LoadError: pg is not part of the bundle. Add it to your Gemfile.
pwpush_custom_heroku_v1.25.2.txt
I have been unable to update since Mid-November, and would like to try out some of the features you have added to the repo, just can't in Heroku apparently.
Apologies for the ongoing Heroku issues @bprobst-msis. I can't even test Heroku now because they require a credit card for the paid dynos.
There was a recent change to the app where you have to run bundle config set with 'postgres'
(other values are sqlite
or mysql
) before bundle install
. You can see this in the postgres Dockerfile.
I think for heroku there is no app.json setting for this but instead you have to add an environment variable BUNDLE_WITH=postgres
.
I hope this helps. Heroku is going to be challenging to support going forward but I'll do my best for as long as I can.
Thank You for providing the BUNDLE_WITH=postgres
environment variable, that allowed me to update my current instance with no issues (except one of my own making on one of the pages, silly apostrophe had to be escaped).
At least now I can complete a build again!
I was just able to confirm forcing the stack to heroku-20 and setting bundle_with=postgres in the app.json
file allowed a new dyno to be deployed (at least it should work until that stack is retired).
[...]
"scripts": {
"postdeploy": "bundle exec rake db:migrate"
},
"stack": "heroku-20",
"env": {
"BUNDLE_WITH": "postgres",
"BUNDLE_WITHOUT": "development:test:private",
[...]
! The Ruby version you are trying to install does not exist on this stack. ! ! You are trying to install ruby-3.0.4 on heroku-22. ! ! Ruby ruby-3.0.4 is present on the following stacks: ! ! - heroku-18 ! - heroku-20
If you set the environment variable CUSTOM_RUBY_VERSION=3.2.0
and set the stack to "heroku-22" it should work.
From this doc:
If your Gemfile does not contain a ruby entry, you will get MRI 3.1.2.
Default rubies are locked into the app until you specify a Ruby version. For example, if your app is using a default Ruby version of 3.0.3, you will continue to stay on 3.0.3.
We highly recommend specifying a Ruby version in your Gemfile and not relying on the default Ruby version.
The Password Pusher Gemfile contains ruby ENV['CUSTOM_RUBY_VERSION'] || '>=2.7.0'
. We can't call out a single Ruby version due the large number of pwpush users running in various environments.
But I believe if you set CUSTOM_RUBY_VERSION
it should get around this issue.
Could you give that a try and let me know?
From what I have been able to determine so far, the Gemfile.lock
file version will always "win" any version declarations, which is why it is trying to utilize ruby 3.0.4 as defined in that file.
I have still not found a way around this.
From what I have been able to determine so far, the Gemfile.lock file version will always "win" any version declarations, which is why it is trying to utilize ruby 3.0.4 as defined in that file.
But doesn't the buildpack run bundle install
anyways? It should rewrite that Gemfile.lock I would think.
When I ran on Heroku, I was able to set a config var CUSTOM_RUBY_VERSION=3.1.2
and it used the right Ruby. This was more than a year ago though...
Attempted a new deployment to Heroku and it failed when configuring Ruby.
As per documentation linked in the error:
I am unfortunately not proficient with Ruby at all, otherwise I would probably attempt to update the version requirement myself.