I'm working on a Drupal 8 site which is deployed on Heroku, how would I run Drush or Drupal commands on here? When I try it with the built in command line on the Heroku site it complains about MySQL not being present. Is it possible to run Drush or Drupal commands on Heroku? Could I run the commands locally but somehow connect to the Heroku boxes?
I got in touch with Heroku support and managed to resolve the problem, in order to install MySQL you have to use their buildpacks.
If you go to your App > Settings > Buildpacks section you can add https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/apt.tgz which from what I understand allows you to install packages using an Aptfile in your repository.
Once that Buildpack has been added in the root of your code that's deployed to Heroku add a file named "Aptfile", no extension and add the following two lines to it:
mysql-common
mysql-client
I'm not sure if mysql-common is needed but mysql-client certainly is. Deploy this to your Heroku environment and you should be able to run Drush commands now, be sure to add that Buildpack before adding the Aptfile as adding the Buildpack only adds it on the next environment build which happens with a new commit.
Running Drush is pretty easy ones you've done this. To do it via the web interface click the "More" button near the top right of the screen when you're looking at your app in Heroku and select "Open Console" then enter bash in the new panel and click "Run". Now you should be able to run Drush commands from here.
If you want to run the from your local terminal use https://devcenter.heroku.com/articles/one-off-dynos#an-example-one-off-dyno in the Heroku CLI (which you'll have to install). You may have to use the --dyno or --app flags to run Drush in the correct place.
Related
Is it possible to run heroku-cli-commands like heroku regions from the Heroku Dashboard?
I tried to run those in the console, but it did not work..
From the heroku explanation page, as well as the appearance of the console, it seems that you can only run commands that start with heroku run (Example: npm start).
That means you can run commands there for the app, and heroku will pass them to it. Like you could run if the app was running on your computer. But do not run regular heroku cli commands, for example install an add-on, through the dashboard on the website, but only through heroku cli
Hi i am trying to deploy my project i develop in Clojure to heroku. it created and build too but
when i write heroku open it gives error and logs saying missing build
You are using heroky "autodetect" and it's detecting your npm file and trying to start it as a npm project.
You need to specify to use clojure buildpack in somewhere inside heroku settings.
I recommend you to move into "docker mode" in heroku, that will give you more control about how to build/run your project.
I deployed Parse-Server-exemple to Heroku using thee Deploy button, and everything is working fine. (up to the fact that there are some bugs)
But the Parse-Server(https://github.com/ParsePlatform/parse-server)is being updated more frequently and now has lower bugs.
How to deploy Parse-Server on Heroku ?? or at least how to update the server running on my existing Heroku app ?? I can't find the answer anywhere
Parse-server is the nodejs package. you can remove this line here and you can remove the node_modules from .gitignore, then you need to download the "Parse Server" to your node_modles folder and deploy it. but it will be easy if you try to use some service like www.parseground.com
Your starting point should be reading up on how to deploy nodejs apps on heroku. Parse Server is just another npm module. Contrary to #pivanov's answer you should preferably keep node_modules in gitignore and let heroku install the npm packages including Parse Server. This is what heroku recommends in their documentation.
You can clone your parse-apps by running the falling command using the heroku work belt
$ heroku login
$ heroku git:clone -a
Heroku at this point automatically create a git branch 'master' that you can commit to.
You can now make changes to your parse server version depending in the available version.
Current version i think is 2.1.4
"parse-server": "^2.1.4",
You can now commit and push changes to the master branch created.
$ git add .
$ git commit -am "make it better"
$ git push heroku master
You can use
npm update
it will update the parse server if you have used "*" as its version in your package.json file.
When I use the command heroku addons create:graphenedb --version v195. It gives error "No app specified , Run this command from an app folder or specify which app to use." I am new to Heroku and I do not understand which app folder it is talking about.
If you're not in your project folder or if it doesn't have a git remote to point it to Heroku you need to use the --app flag for the heroku command to specify the name of your app on Heroku
so I have building management app, which locally uses the pdftk to generate pdf forms (prefilled with tenant/expense data). Works like magic on my local machine.
However, on Heroku I get the error:
pdftk executable /usr/local/bin/pdftk not found
in the logs when I try to generate the pdf file. I realize that I need to install pdftk on my heroku app using a buildpack. I've tried following some tutorials with Vulcan, but vulcan is deprecated and they say use heroku run, however I can't find much documentation of how to install the pdftk-source: https://github.com/millie/pdftk-source using heroku run.
I'm going to try https://github.com/millie/heroku-buildpack-ruby-pdftk, but if there is an easier/less messy way let me know, thanks!
EDIT:
Tried the above method, and now my heroku logs say:
RuntimeError (pdftk executable /app/vendor/pdftk/bin not found)
So I'm thinking the buildpack didn't include pdftk to begin with, which doesn't make sense.
I must be doing something wrong, but I followed the instructions exactly, only difference is I used dropbox instead of S3 to store the tar.gz file (the pdftk source)
EDIT:
OK, I figured out how to include pdftk executable in the heroku buildpack and upload it successfully as part of the app environment. HOWEVER, for some very strange reason, in the heroku bash console, when I cd into pdftk directory and try to run the executable, heroku bash says pdftk executable not found.
It works on my local machine, when cd into the pdftk directory and run pdftk, it runs the executable, so its not the executable..so why isn't it working inside the heroku bash directory?
SOLUTION:
Was missing setting LD_LIBRARY_PATH in my config vars on heroku, because pdftk relies on a library file. Also, remember to tar the tar.gz to the root directory and set a PATH to /bin/pdftk. Just check out #heroku on IRC, that's where I got my answer.
Was missing setting LD_LIBRARY_PATH in my config vars on heroku, because pdftk relies on a library file. Also, remember to tar the tar.gz to the root directory and set a PATH to /bin/pdftk. Just check out #heroku on IRC, that's where I got my answer.
This is how i setup pdftk in nodejs app in heroku
Create heroku app
heroku create
Set buildpack for pdftk
BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-apt
Set buildpack for nodejs
heroku buildpacks:add --index 1 heroku/nodejs
Add the libgcj.so.* to your search path:
heroku config:set LD_LIBRARY_PATH=/app/bin
Turn on at least one dyno
heroku ps:scale web=1
Create a Procfile in the root of your project and define the following:
web: node server.js
Push changes in heroku
git push heroku master
Adding answer that worked as of July 2019
Note: Thanks to shake-apps for creating the Buildpack https://elements.heroku.com/buildpacks/shake-apps/heroku-buildpack-pdftk
If you need to have PDFtk installed on Heroku for a Node JS Application, follow these instructions:
Heroku Installation
You'll need to set the base nodejs buildpack, and the pdftk buildpack by shake-apps.
Set them by running the following:
heroku buildpacks:set heroku/nodejs;
heroku buildpacks:add --index 1 https://github.com/shake-apps/heroku-buildpack-pdftk.git;
After build packs are set, the server can be deployed normally with
git push heroku master
If you have any issues with the deploy it could be your previous buildpack. You can clear it to start fresh with:
heroku buildpacks:clear