Heroku Garden Local Development Basics

© Heroku Garden
Introduction
For those of you familiar with Heroku, you will know that web applications originally developed for Heroku have been transitioned to Heroku Garden. The transition hasn’t been smooth by any means but the team at Heroku has been responsive both in terms of email and Twitter correspondence so I suppose I can’t grumble to much. That said, I’m still left feeling a bit uneasy with the whole experience. BTW, you can read more about the transition here.
While the idea behind Heroku/Heroku Garden applications (namely Ruby on Rails applications) is that you can develop them via a web interface as they are hosted in the cloud, it is not always the most desirable. The following is a breakdown of how to go about developing your Heroku Garden Ruby on Rails application(s) from your local development machine. Keep in mind that some of this information will also apply to your Heroku production apps as well.
Gems
Heroku has developed a couple of gems worth noting that makes local development much easier:
- heroku - For production use. To install type:
sudo gem install heroku. - herokugarden - For testing and rapid prototyping. To install type:
sudo gem install herokugarden.
Both require the rest-client gem which you will get automatically when installing either of the gems listed above. Read my previous post if you have issues. For the purposes of this demonstration, stick with the herokugarden gem.
Setup
So to get started, follow these steps (assuming you already have git installed):
- Register and create a HerokuGarden account if you don’t already have one.
- Create a new app by clicking the “Create New App” button and adjust your settings as you see fit:

(click to view) - Install the herokugarden gem mentioned above.
- Execute the following command to create a private and public key to be used by Heroku:
ssh-keygen -t rsa. Accept the default file name and either enter or do not enter a passphrase when prompted. This will create an id_rsa and id_rsa.pub file in your/Users/<login>/.sshdirectory (assuming you are on MacOS). - Now you need to create your heroku credentials. The easiest way to do this is to simply type
herokugarden listfrom the command line. - At this point you will be prompted for your Heroku Garden email address and password (i.e. the same credentials you used to setup your Heroku account in the first place). This might take some time to finish. The command line output should look something like this:
Uploading ssh public key /Users/<login>/.ssh/id_rsa.pub. - Once the upload completes, you’ll see a list of your app names printed in the console. The app names are important for the next step so make note of it. You should also notice that your Heroku Garden credentials have been created in the following location:
/Users/<login>/.heroku/herokugarden_credentials. - Now lets check out your newly created Heroku Garden project so you can work on it locally. Type the following command:
git clone git@herokugarden.com:<app name>.git. Use the app name from the list mentioned in the previous step for your specific app name.
At this point you can use git to manage your application locally and commit changes back to the server. One thing to consider is that when you first create a local copy of your Heroku Garden project, you will have symbolic links to to the log and tmp directories. You might want to delete and recreate them and then add them to your .gitignore file in the root of the project.
As a you make local changes to your code, you’ll want to commit these changes back to the Heroku Garden git repository. Here is a quick sequence of commands to run in order to save yoru changes and have your Rails app restart:
git add .git commit -m "Enter your personalized comment(s) here"git push
Heroku Garden video tutorials for deploy and import can be found here.
Rails
From here on out you should be able to run Rails as you normally would. Just open two console tabs on the root of your project so you can run the server (i.e. script/server -u) and manage your console (script/console).
Parting Thoughts
As mentioned earlier, I have mixed feelings about Heroku. It’s a cool and quick to prototype with but has stability issues. I might talk more about these issues in the future but as thoughtbot team has mentioned before, it’s a great way to get up and running quickly on the Rails framework. Plus, at the moment, it is free to use.
No comments yet.
Leave a comment
You must be logged in to post a comment.
Search
Categories
- Adventures
(129)
- Announcements
(37)
- Business
(20)
- Electronics
(21)
- Epicurean
(10)
- Games
(2)
- Literature
(1)
- Mechanical
(4)
- Meetups
(17)
- Movies
(2)
- Music
(26)
- Photography
(1)
- Services
(28)
- Software
(128)