I am porting a Heroku app from Aspen to Cedar stack at Heroku, following their instructions.
I'm at the last deploy step. I get this error:
2012-10-22T11:23:53+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 40310 -e production`
2012-10-22T11:23:54+00:00 app[web.1]: bash: bundle: command not found
I can't see how I can be responsible for telling the Heroku stack where bundle is, or providing it, since bundler is used by it for exactly this job. This command is specified in the Procfile for the app:
web: bundle exec thin start -p $PORT -e $RACK_ENV
Another similar question on stackoverflow suggests that this happens if the app is pushed to Heroku without a Procfile initially, so Heroku gets the wrong idea about what kind of app it is. That poster deleted his app and created a new one and reported success. However, the effort involved in deleting and recreating my ported app is high. Is there some way I can fix this rather than start over?
Heroku's slug build process must have changed with regard to ruby 1.8.7 apps. I'm guessing they started bundling to 1.8 paths instead of 1.9.1 for 1.8 apps. My previously working app stopped working after I tried to push a new revision.
Here's what got it working again:
heroku config:add PATH=bin:vendor/bundle/1.8/bin:/usr/local/bin:/usr/bin:/bin GEM_PATH=vendor/bundle/1.8
I took these paths from a newly created app using the same git repository as I used before.
EDIT: Turns out that heroku published a devcenter article Changing Ruby Version Breaks Path that specifies paths for various ruby versions.
I had the same issue and I solved it by setting the correct heroku config variables
$ heroku config
=== xxxx Config Vars
DATABASE_URL: postgres://(...)
GEM_PATH: vendor/bundle/ruby/1.9.1
HEROKU_POSTGRESQL_CRIMSON_URL: postgres://(...)
LANG: en_US.UTF-8
PATH: bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
PGBACKUPS_URL: https://(...)
RACK_ENV: production
RAILS_ENV: production
you can create an empty rails app, push it to heroku and check the variables it automatically set, then copy (and adapt) them to your application
Related
I'm doing the tutorial on Heroku Dev Center (found here: https://devcenter.heroku.com/articles/getting-started-with-scala#introduction). I got through all the steps leading up to running my app locally (as far as I can tell the app is deployed properly and I have installed the app dependencies), but when I run the command 'heroku local web -f Procfile.windows' it gives me back an error on web.1 saying "the system cannot find the path specified"... I double checked that web.1 is up using 'heroku ps' command.
Help!
Seems to be related to the JDK version. I was trying to use JDK 10.0.1 and encountered the same problem. When I changed to point to JDK 1.8.0_121 which (I think) Heroku installed, I was able to continue.
The file specified at the Procfile.windows is not available, yet.
web: target\universal\stage\bin\play-getting-started.bat
To solve this, run:
sbt compile stage
in the root of the project directory to produce the required files.
This question already has answers here:
Is there a way to set a default app for Heroku Toolbelt?
(3 answers)
Closed 1 year ago.
Heroku toolbelt is always forcing me to write an app name at the end like this:
heroku pg:reset DATABASE --app [app_name]
Is there a way to set the default app to which all my CLI heroku commands will apply?
Going to post this just in case it helps someone else out. I had the same problem even though there was only one app installed. I had to switch my heroku remote url from https to git.
https://git.heroku.com/[heroku-app-1234].git
to
git#heroku.com:[heroku-app-1234].git
Then everything worked normally for myself.
git remote remove heroku
git remote add heroku git#heroku.com:[heroku-app-1234].git
If heroku is claiming that there are multiple apps in the folder you must have more than one remote in your .git/config.
Remove the extra heroku remote or set the default using git config heroku.remote remote_name
If you have the heroku-accounts plugin installed, switching to the heroku branch worked for me, as discussed in this answer.
To swap out your existing version of the heroku-accounts plugin, use:
heroku plugins:install https://github.com/heroku/heroku-accounts.git
Note that if you've followed #Moemars answer, you'll need to switch your git remote back to https.
If you run heroku from the Git repo linked to your Heroku app, you don't have to specify an app name (unless the repo is connected to multiple apps).
This seems to be the easiest way to fix the issue:
heroku git:remote -a <app_name>
Since this wasn't mentioned until now:
Apart from the git remote, the Heroku CLI also looks into the HEROKU_APP environment variable.
By using direnv, dotenv or similar tools for project-specific environments you can easily set the respective Heroku app for each project or directory.
I am trying to run phantomjs on the heroku cedar stack.
I am using a phantomjs buildpack for heroku https://github.com/stomita/heroku-buildpack-phantomjs.
However I followed the instructions but still cannot make it work.
When I run the command heroku run bash and type phantomjs --version it says phantomjs: command not found
I read things about LD_LIBRARY_PATH that needs to be set to "/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib", this is what i did but without success.
Is there something that i am missing ?
Where does the buildpack install the phantomjs binary exactly ? Is there a way to know the path where the binary is ?
I am using ruby 1.9.2
Thanks a lot for your help.
EDIT: To be more precise, i want to combine ruby and phantomjs, so i am using this custom buildpack: https://github.com/ddollar/heroku-buildpack-multi, but when i push to heroku i get "Heroku push rejected, failed to compile Multipack app"
Download the 64-bit linux binary file from phantomjs.org here http://phantomjs.org/download.html
Create a bin/ directory in your app if you do not already have one and place the binary file there. You should then be able to test if you can run it with "heroku run 'phantomjs'" or "heroku run 'bin/phantomjs'"
For phantomjs with javascript
I dont know if the previous examples are actually necessary becasue although i am working with javascript it should not be different. For me all i had to do was place the phantomjs buildpack as the first on the list of installed buildpacks on your master.
check available buildpacks
open terminal from the app folder and type:
heroku buildpacks
This wll show the available buildpacks.
eg.
1.heroku/node.js
2.https://github.com/stomita/heroku-buildpack-phantomjs.git
As you can see the buildpack is second on this list. We need tomake it the first in the list.So, what i did was i removed the phantomjs builpack and then add it again but this time made sure its first on the list of all available buildpacks.
So, to remove a buildpack, type:
heroku buildpacks:remove https://github.com/stomita/heroku-buildpack-phantomjs.git
this removes the buildpack.You can check it by typing:
heroku buildpacks
Now, it should only show,
1.heroku/node.js
Great, now we add the phantomjs buildackmaking sure its first . So on terminal type:
heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git
You can check if its first by typing:
heroku buildpacks
Now, it should be ,
1.https://github.com/stomita/heroku-buildpack-phantomjs.git
2.heroku/node.js
Thats It!!
now, on terminal , type:
heroku run bash
once you're in bash, type
phantomjs --version
The current verion of phantomjs should be shown on the terminal.
2.1.1
I've been trying to get a heroku console session going on cedar and am having no joy.
The old way was:
heroku console
I understand the new way involves 2 steps:
heroku run bash
then
$ rails console
but at the heroku run bash stage i keep geting:
heroku run bash
Running `bash` attached to terminal... up, run.1
!
! Timeout awaiting process
so i checked there isn't a port blocking issue and
telnet rendezvous.heroku.com 5000
gives
Trying 50.19.103.36...
Connected to ec2-50-19-103-36.compute-1.amazonaws.com.
Escape character is '^]'.
which is as expected i think
what am i doing wrong and what do i need to do to get this console up and running?
Thanks!
PS I have tried - heroku run console - also, and that times out too.
In cedar every command that needs to be attached to terminal uses run.
ex:
heroku run console
heroku run rake db:migrate
When its not necessary to be attached don't use the run:
ex: heroku logs
The new way is heroku run console
Ok - it was obvious after a few hours of sleep. Simply had to update the heroku gem that had got corrupted somehow on my mac. If you have something like this problem, then do that first...
Trying to debug a new Heroku deployment - seems to be missing a db table. To do this, I'm running heroku run console but I get back :-
Running console attached to terminal... up, run.7
sh: console: not found
under both my Linux and Windows environments
What have I missed to get this working?
[Very late update : this is for a Java Heroku app, not a RoR one, so anything related to rails is a little lost on me]
on Celadon Cedar Stack it is changed to:
$ heroku run bash
$ heroku run bash
then
…#…:/app$ script/rails console
It worked for me. Though the second step is specific to Ruby on Rails – I don’t know the equivalent commands for other platforms and frameworks.
To run rails console, it's just:
heroku run rails console