Foursquare + Rails + Heroku

Reading Time: 2 minutes

A few days ago I was just doing research about gems to handle the Foursquare API, I was wondering how to have this interaction between Rails and Foursquare. I found this Gem, so this is my review and the steps you need to follow to start using it:

Foursquare rails generators
(Rails app + Foursquare running on Heroku.)

With the following lines of code you will create a new app with Foursquare and deploy it to Heroku:

$ rails new your-unique-app-name -d postgresql -m

Note: try to make sure {your-unique-app-name} is truly unique or Heroku won't let you create an app with a name that has already been taken.

After that code, you will see this:

your app's name:  my-foursquare-data
Download / welcome page url:
Callback url:
Push url:

Then you will be asked to register your app on Foursquare like this:

please register your app my-foursquare-data on

image alt

Once you register your application, you will need to introduce the following app keys in the terminal.



This will automatically create your address as well as the Heroku project, and it will be deployed to production.

Note: you need to be logged in to Heroku in your terminal.
Heroku devcenter.

The good and the not-so-good

In my opinion, the not-so-good side to using this gem is the following:
  • "For now, it's only available when you create a new Rails app from scratch."
  • Sometimes the bundle fails, so you need to be careful
The good things:
  • The setup is very fast, it takes about a minute
  • Easy to use and handle

I encourage you to experiment with this gem, and fork it: Foursquare rails generators

Follow me on Twitter, I'm @zazvick, and also read me at PolyglotCoder

Thanks for reading!

You May Also Like
Read More

Lambda In ActiveRecord

Reading Time: 2 minutes On one occasion, I had a problem with a couple of ActiveRecord scopes. The problem showed up when…