Heroku Jammit GEM with the latest Heroku Gem
-
14-11-2019 - |
Pregunta
I've been using the following heroku jammit gem for deploying:
https://github.com/kylejginavan/heroku_jammit/blob/master/lib/heroku_jammit.rb
During a nightly deployment, heroku had me update my heroku gem, which then broke this jammit gem. I now get the following error:
===== Deploying assets for to heroku...
! Invalid path.
! Syntax is: git@heroku.com:<app>.git where <app> is your app's name
fatal: The remote end hung up unexpectedly
[FAIL]
===== Done...
===== Deleting compiled assets...[OK]
===== Commiting deleted assets...[OK]
===== Done...
In the heroku_jammit gem '/lib/heroku_jammit.rb'
line 84: run "git push git@heroku.com:#{@app}.git #{branch}:master"
Any suggestions on how to update this line to work with the new heroku gem?
Thanks
Solución
The API of the Heroku gem changed. Before 2.0 @app
was defined with an attr_reader
. In version 2.0+ it's a method. The fix is to change the instance variable call to @app
to a method call to app
.
We fixed this in our pull request which has been accepted.
Otros consejos
I had the same problem. My solution is hard and dirty, but I found out, that @app is not defined anymore(inside the plugin). If you have a remote stage and a production head, heroku always ask me: please add -app [app-name] to specify....I tried it and it worked for me....
- the plugin lives in your users-home-folder: ~/.heroku/plugins/heroku_jammit
goto ~/.heroku/plugins/heroku_jammit/lib/heroku_jammit.rb and add following line(near 78): heroku_jammit.rb:
def deploy
fail_if_jammit_not_installed!
is_root?
branch = set_branch
after this write:
@app=@options[:app]
and you can commit with:
heroku jammit:deploy --app [your-app-name]
I'm on rails 2.3.11, ruby-1.8.7-p334 (with rvm) - in development everything works fine. On heroku I get erros with assets.yml. I tried all jammit version from 0.4.4 to now, but I stuck and look now for a new solution.
Good luck....