Skip to content

Instantly share code, notes, and snippets.

@carols10cents
Last active December 13, 2015 21:38
Show Gist options
  • Save carols10cents/4979026 to your computer and use it in GitHub Desktop.
Save carols10cents/4979026 to your computer and use it in GitHub Desktop.
How to deploy your own rstat.us node on heroku

How to deploy an rstat.us node on heroku

These instructions are meant to make it possible for anyone to deploy their own rstat.us node to heroku for free. If any of these steps are confusing or scary, we need to do a better job explaining it or making the process easier. Please leave a comment and we will help <3

  • Sign up for a free account at heroku.com

  • Install the Heroku Toolbelt and follow the instructions on that page through the end of the heroku login section, but you do not need to do the heroku create section yet.

  • Get a checkout of the rstat.us code. In your command line application, go to the directory on your computer where you would like to keep the rstat.us code and run:

    git clone git@github.com:hotsh/rstat.us.git

  • Then go into the directory that was just created that holds the rstat.us code:

    cd rstat.us

  • Install ruby and bundler (this step needs to be expanded into multiple steps), then run:

    bundle install

  • Now create a new heroku app by running:

    heroku create

  • This should say something that looks like:

    Creating polar-peak-1173... done, stack is cedar http://polar-peak-1173.herokuapp.com/ | git@heroku.com:polar-peak-1173.git

In this example, "polar-peak-1173" is the name of the app.

  • On heroku.com, when you're logged in, go to "My Apps" and click on the app you just created.

  • Under the Add-ons section, click on "Get Add-ons".

  • Search for "MongoHQ", choose the free "MongoHQ Sandbox" plan, select the app you just created in the dropdown, and click the "Add" button.

  • In your command line, generate a new secret token by running:

    rake secret

This will output a long string of random characters. DO NOT SHARE THIS WITH ANYONE, COMMIT IT USING GIT, OR POST IT ANYWHERE ONLINE. Instead, add it as a heroku config variable by running:

heroku config:add SECRET_TOKEN=paste-the-really-long-string-here
  • Add twitter integration:

    • Go to https://dev.twitter.com

    • Sign in using a valid Twitter account

    • Hover over your username in the top right and select "My applications"

    • Select "Create a new application"

    • Fill in all the required fields (you can use made up information if you'd like) and be sure to add your app's url as the "Callback URL" - in the example above, it would be http://polar-peak-1173.herokuapp.com

    • Go to the settings tab and select "Read and Write" for the application's access type

    • Add your twitter keys as heroku config variables by running:

      heroku config:add CONSUMER_KEY=paste-your-twitter-application-consumer-key-here CONSUMER_SECRET=paste-your-twitter-application-consumer-secret-here

  • Finally, deploy rstat.us' code to that app by running:

    git push heroku master

The end of this should say something like:

http://your-app-name.herokuapp.com deployed to Heroku

Go to that url and start using your very own rstat.us node!

Remember, please let us know if you run into any trouble, we are happy to help!!! <3

You can leave a comment on this gist, tweet at me @carols10cents, or email me at carol dot nichols at gmail dot com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment