Can a Rails application be deployed without using the Heroku Toolbelt? If so, how?

I want to deploy a rails app without using Heroku ToolBelt. Is it possible? If so, how? I am allowed to use the Heroku dashboard; I am not allowed to use any other cloud services :(

I need to run PostgreSQL commands, add add-ons and set up config variables and possibly other tasks for which we have a Heroku Toolbelt to deploy the application to production.

Mistake:

user@xx ~/Desktop/github/blog (master)
$ git push git@heroku.com:herokugui.git master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

      

I don't want to use Heroku Toolbelt. This is why I use Git commands to deploy my code to Heroku. I cannot push code to Heroku using Git commands. Can this task be accomplished without a toolbox?

Another question: Is there a way to run PostgreSQL commands in Heroku GUI? If so, how?

+3


source to share


1 answer


It's not easy (as with the Heroku toolbelt), but it's possible. At least this is due to the fact that you are hooking the Heroku dashboard, so make sure you can access it.

First of all, you need a key. If you are on a Linux machine (like me), then in your home directory you should have a folder named .ssh

(it may be hidden, click Ctrl+H

to show again if Linux) and a file id_rsa.pub

. If not, you first need to generate your SSH key.

ssh-keygen -t rsa

      

This will prompt you for a folder, by default this is ok, just click Enter

, then enter the passphrase (twice) to protect your key from being accessed by anyone else on your computer: no passphrase it is unencrypted and free for anyone who accepts and uses from this machine.

Once this is done, locate the public key file id_rsa.pub

. Note : no id_rsa

, this is a private key, you might not want to give it to anyone, this is very similar to your future Heroku password, except it's insanely large for a password. Open up id_rsa.pub

, you should see things like:

ssh-rsa aWhOLELotofUnreadABLEGibbERishWHiCHiSactUALLyYourPubLIcKeY...

      

You need to enter this line in your account settings in the Heroku dashboard under SSH Keys . More information on keys can be found here in the Heroku docs . Make sure Heroku really recognizes you by issuing this:



ssh -v git@heroku.com

      

It should indicate that you are authenticated.

Now for the address git

. I assume you know your way around git

, so I'll keep it posted: you will need to infer your repository address from your application name. Heroku usually generates strange (but somewhat poetic) names like falling-wind-1624

or shielded-fjord-1858

. I'll take the first example as an example, so you add its address as a git remote:

git remote add heroku git@heroku.com:falling-wind-1624.git

      

I'll cover that a little bit below. So what toolbelt does is only use your app name, it just creates the url in the same way, adding the path to the Heroku server. After that, you should be able to push the code:

git push heroku master

      

I named the remote heroku

Heroku, that's why I'm using the name heroku

here, you can name it whatever you want and use it afterwards. Once you've hit the code, the rest is up to you.

+8


source







All Articles