Hi StackOverflow community,
I want to use xvfb buildpack in heroku.
However, I always get the error in this link.
I have a list of buildpacks added in heroku:
* heroku/php
* heroku/python
* https:// github.com/heroku/heroku-buildpack-apt
* https:// elements.heroku.com/buildpacks/captain401/heroku-buildpack-xvfb
$ heroku buildpacks:add heroku/php
$ heroku buildpacks:add heroku/python
$ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-apt
$ heroku buildpacks:add https://elements.heroku.com/buildpacks/captain401/heroku-buildpack-xvfb
$ git push heroku master
Everything is up to date
$ heroku logs --tail
app[web.1]: cmd=['Xvfb','-help']
app[web.1]: ubuntu_package=PACKAGE).check_installed()
app[web.1]: Program install error!
app[web.1]: __init__.py", line 180, in check_installed
app[web.1]: raise EasyProcessCheckInstalledError(self)
app[web.1]: [2017-05-15 03:31:42] app.DEBUG: < 200 [] []
app[web.1]: OSError=[Errno 2] No such file or directory
What seems to be wrong?
I've made things work using https://github.com/heroku/heroku-buildpack-apt.
Specifically running:
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
Related
My apologies if this is a dumb question. I am not familiar with anything about Ruby. Also tried several solutions from SO. Managed to upgrade Ruby, resolve dependencies. Now just stuck and not able to move ahead. Any help is appreciated.
Thank you.
When I push, I get ruby v2.2.2 but I just upgraded to 2.5.7 which is supported by heroku-18.
Here are CLI records:
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.2.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.2.2.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.2.2
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to appname-heroku18.
remote:
To https://git.heroku.com/appname-heroku18.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appname-heroku18.git'
Mac-Air:appname developer$ ruby -v
ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin18]
Mac-Air:appname developer$ heroku run ruby -v
› Error: Multiple apps in git remotes
› Usage: --remote heroku-18
› or: --app appname-heroku18
› Your local git repository has more than 1 app referenced in git
› remotes.
› Because of this, we can't determine which app you want to run this
› command against.
› Specify the app you want with --app or --remote.
› Heroku remotes in repo:
› appname (heroku)
› appname-heroku18 (heroku-18)
›
› https://devcenter.heroku.com/articles/multiple-environments
Mac-Air:appname developer$ heroku run ruby -v --remote
› Error: Flag --remote expects a value
Mac-Air:appname developer$ heroku run ruby -v --remote heroku
Running ruby -v on ⬢ appname... up, run.1515 (Free)
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
Mac-Air:appname developer$ heroku run ruby -v --remote heroku-18
Running ruby -v on ⬢ appname-heroku18... up, run.1012 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
Mac-Air:appname developer$ heroku run ruby -v --app appname-heroku18
Running ruby -v on ⬢ appanme-heroku18... up, run.6356 (Free)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
you have two apps in your remote that is currently referenced by your git.
just specify the app name in your push command.
git push ... --app appname-heroku18
It seems to me that you have locked the Ruby version. That's why it keeps trying to install Ruby 2.2.2. By default it should just pick a stable Ruby version.
Look into your Gemfile for a ruby entry. There it should say 2.2.2. Either remove it or lock the version to 2.5.7.
-> git push heroku master #I run this in my app and I got the error message for the app.
I check the "config" file under the "./git/" It IS showing 2 Apps:
[remote "origin"]
url = https://git.heroku.com/yinow.git
fetch = +refs/heads/*:refs/remotes/origin/*
# [remote "heroku"]
# url = https://git.heroku.com/yinow.git
# fetch = +refs/heads/*:refs/remotes/heroku/***
I comment out the "heroku" part as above, and run the push command again like this:
-> git push origin master
and the problem gone!
Ever since I upgraded to rails 6 and installed webpacker I've been getting this message in production:
2019-10-06T10:57:14.221369+00:00 app[web.1]: E, [2019-10-06T10:57:14.221154 #4] ERROR -- : [5e6a4fed-5c09-44fa-a840-24badc9f6a99] [Webpacker] Compilation failed:
2019-10-06T10:57:14.221389+00:00 app[web.1]: error Command "webpack" not found.
There are no further details and it appears that all my js is working fine.
Any ideas?
Try
heroku buildpacks:add --index 1 heroku/nodejs
heroku buildpacks:add --index 2 heroku/ruby
Per
https://github.com/rails/webpacker/issues/512#issuecomment-309268946
Also,
Yarn should be included on heroku by default (per this article) if you have the webpacker gem in the Gemfile.
I want to restore the backup from staging to demo
I followed the documentation on heroku and combed through SO but no luck so far.
I am using Windows 7 and versions are:
heroku/toolbelt/2.33.2 (i386-mingw32) ruby/1.9.2
Ruby: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Rails: 3.2.7
Steps:
$heroku pgbackups:capture
HEROKU_POSTGRESQL_ONYX_URL (DATABASE_URL) ----backup---> b004
←[0KCapturing... donet |
←[0KStoring... done
$heroku pgbackups:url
"https://s3.amazonaws.com/hkpgbackups........."
I know the command above is not required but I did it anyway just to make sure that a url is generated for backup db.
and the command for restore:
$heroku pgbackups:restore --remote demo DATABASE 'heroku pgbackups:url'
**! Backup not found**
Just to be sure, I tried the following other formats of the command:
heroku pgbackups:restore --remote demo DATABASE 'heroku pgbackups:url --remote staging'
heroku pgbackups:restore --app demoapp DATABASE 'heroku pgbackups:url --app stagingapp'
They both are resulting in Backup not found error
I also tried with the name of the db on demo:
$heroku pgbackups:restore HEROKU_POSTGRESQL_ROSE 'heroku pgbackups:url --remote staging' --remote demo
! Backup not found
Please help!
Use backquotes instead of single quotes.
` heroku pgbackups:url -a source-app `
Log into your heroku control panel and make sure the version of PGbackup you have isn't depreciated
I can find my apps in heroku apps command, and also do some command to read information from app like heroku addons --app appname.
But I couldn't find my apps in some command like heroku addons:add addon_name, heroku pg:reset.
Work commands
heroku apps:
=== My Apps
my_app_1
my_app_2
(Also I can see my apps in heroku web dashboard.)
heroku addons --app my_app_1(not in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
heroku addons(in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
Doesn't work commands
heroku addons:add sendgrid(in my_app_1 folder):
! No app specified.
! Run this command from an app folder or specify which app to use with --app
heroku pg:reset DATABASE --confirm my_app_1(in my_app_1 folder):
Resetting SHARED_DATABASE (DATABASE_URL)... failed
! Resource not found
Here is my environment.
Max OS X Lion (10.7.4)
rvm 1.13.8 (stable)
ruby 1.9.3p194
heroku 2.26.5
Adding the heroku's remote configuration to git did the trick for me. Validate if you have it configured with git remote -v on the terminal and you should get something like:
heroku git#heroku.com:your-app.git (fetch)
heroku git#heroku.com:your-app.git (push)
if you don't, add it with
git remote add heroku git#heroku.com:your-app.git
It looks like the latest version fo the Heroku gem (2.26.5) is broken. A workaround is to downgrade to 2.26.3.
gem uninstall heroku -v 2.26.5
gem install heroku -v 2.26.3
It looks like you have a conflict between the Heroku gem, and the Heroku Toolbelt. I'm guessing you have installed the Heroku Toolbelt, but still have the Heroku gem in your gem file.
Remove the Heroku gem from your Gemfile and save.
Run the bundle command to update your Gemfile.lock
In Terminal, run gem uninstall heroku (NOTE: there may be multiple versions of the Heroku gem installed, and you'll need to uninstall all of them.)
In Terminal, run heroku addons
If you get heroku: command not found then you don't have the Heroku Toolbelt installed.
Install the Heroku Toolbelt and run the command again.
NOTE: If you're not in the app's directory, you'll need to add --app myapp1 to the Heroku commands.
Hope this helps.
I'm currently using asset_sync in my Rails app, and I have the environment variables set in my Heroku app. When I run heroku config I get:
AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXX
FOG_DIRECTORY: MY-BUCKET-NAME
FOG_PROVIDER: AWS
etc...
When I push my app to Heroku, it tries to run rake assets:precompile and I get the following message:
Preparing app for Rails asset pipeline
Running: rake assets:precompile
/usr/local/bin/ruby /tmp/build_2pa7aisux9av8/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
AssetSync: using /tmp/build_2pa7aisux9av8/config/initializers/asset_sync.rb
rake aborted!
Fog directory can't be blank, Aws access key can't be blank, Aws secret access key can't be blank
But then I run:
heroku run rake assets:precompile --app my-app-name
...and it processes everything and syncs to S3 just fine:
Running `rake assets:precompile` attached to terminal... up, run.1
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets
AssetSync: using /app/config/initializers/asset_sync.rb
/usr/local/bin/ruby /app/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:nondigest RAILS_ENV=staging RAILS_GROUPS=assets
AssetSync: using /app/config/initializers/asset_sync.rb
AssetSync: Syncing.
Using: Directory Search of /app/public/assets
Uploading: assets/application-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.css
Uploading: assets/application-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.css.gz
Uploading: assets/application-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.css.gz
Uploading: assets/application-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.css
AssetSync: Done.
Any ideas why it wouldn't work during the push but it would work fine when I heroku run rake assets:precompile?
I had the same problem on one of our servers, until I found the documentation on the asset_sync github page that says you need to run
heroku labs:enable user-env-compile --app <appname>
in order for it to work.
Heroku also has AssetSync documentation
It's so nice to only be compiling assets once now
I can see you're running the assets:precompile rake task with --app my-app-name option. Just to be sure, do you have multiple apps on Heroku? (eg. staging and production). If you do make sure make sure running heroku config --app my-app-name results in the output you had with heroku config.
If you had the expected results with the above command, it's likely the ENV vars aren't available on git push as suggested here asset_sync_test github readme . You can go around that by using the following in your config/environments/*.rb file:
config.asset_sync.aws_access_key = ENV['AWS_ACCESS_KEY_ID']
config.asset_sync.aws_access_secret = ENV['AWS_SECRET_ACCESS_KEY']
config.asset_sync.aws_bucket = ENV['FOG_DIRECTORY']
config.asset_sync.fog_provider = ENV['FOG_PROVIDER']