Discourse as Your First Rails App

Good catch, @zogstrip, I’ve updated the post with this.

So, my goal with titling the article as such was to try to succinctly convey to non-Ruby folk, who’ve been contemplating Ruby, to take the plunge. As @sam’s pointed out, there really is no easy way on Windows, and it’s been my experience with some developers, confusing and terse instructions on a myriad of components tend to turn them away.

This next sentence is going to suck to hear, so I apologize in advance:

Some developers simply do not know what ‘bootstrapping’ means.

I wanted the approach to this to be as straightforward as possible, with as few barriers to frustrate and/or confuse users as possible. My strategy here is that a much larger chunk of folks:

  1. Already know how to develop in a particular language, to a certain degree,
  2. Have heard of Ruby-on-Rails and are intrigued,
  3. Want to get started for the first time, but may have been previously intimated by other tutorials, or frustrated at the setup process, and
  4. Would really just like to start by looking at an app that works.

Thus, the title of the article.

1 Like

By any chance, is the image available in Hyper-V format? Do you plan to support Hyper-V in the future?

1 Like


If you want to lobby the Vagrant team to support Hyper-V. I believe they support VMWare but not on Windows at the moment.

I just want to emphasise how much I appreciated this post. I’ve tried getting Vagrant up on Windows before (“Unixism” is a great word for it) and the process failed for me in myriad ways.

Aside: since then, I’ve discovered gow (Gnu On Windows), which is a really lightweight and portable library of binaries like ssh, curl, and the basics like ls - it’s a lot more convenient than Cygwin. Cygwin can be agonising when you have to deal with Ruby gems. It’s also a smidgeon more convenient than Git Bash in quite a lot of places.

Anyway, thanks so much for making this process a bit clearer. I can’t wait to have a look around Discourse - this is my first post, and I’m astounded by how perfectly considered the UI design is.


Here is a quick and dirty translation of Getting Started for Debian/Ubuntu users if you want to toss it in a script or something:

  1. sudo apt-get install git virtualbox nfs-common nfs-kernel-server
  2. wget http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_x86_64.deb
  3. sudo dpkg -i vagrant_x86_64.deb
  4. Open a terminal
  5. Clone the project: git clone git@github.com:discourse/discourse.git
  6. Enter the project directory: cd discourse

Then continue on with the rest of the instructions … (I’m getting an error with the NFS client thing, but that should work, I’m investigating that and will update this when I find the cause.)


I found you also need to add nfs-kernel-server to the list of packages to apt-get install. That got past all my NFS related errors.


A quick note to say that I was getting this error following the instructions on OS X:

[default] Mounting NFS shared folders…

The following SSH command
responded with a non-zero exit status. Vagrant assumes that this means
the command failed!

mount -o vers=3’/path_to/folder’

Fix was very simple, simply make a directory called “vagrant” in the root of the drive you’re running the VM.

Macbook-Air:/ Sina$ sudo mkdir vagrant

Hope that helps someone getting started …

1 Like

To add to your reply to @ndc, they just recently released a way to add a new provider, so it is possible to get it going on hyper-v if someone was willing to do the leg-work for vagarent. http://docs.vagrantup.com/v2/plugins/providers.html

I’m not familiar enough with vagrant to know if its something i’m going to be looking into or not, but I am interested in automating deployments to various VMs. Thanks for pointing it out.

With windows 8 coming with hyper-v as an install option out of box, it sounds like a no-brainer. Also, the free version of hyper-v 2012 is excellent. I just set up a cluster of 3 machines in my basement and have been using no shared state live-migration to offload working servers that I set up on my windows-8 box onto the cluster. its fantastic.

1 Like

thx, had the same problem! maybe @Hanzo could add that to the blog post?

1 Like

Thx, awesome writeup, had it running locally in about an hour.

I searched for hints on Heroku deployment but didn’t find anything definite. Do I simply follow https://devcenter.heroku.com/articles/rails3?

You didn’t look at discourse/docs at master · discourse/discourse · GitHub ?

I got many hits by searching here for “heroku”

Sorry, my bad, searched here on meta only. Yes, many hits, but not what I was hoping for.

For anybody else looking for this: the Heroku step-by-step guide is of course in the docs at https://github.com/discourse/discourse/blob/master/docs/HEROKU.md

A reminder/pointer to the docs would maybe helpful as an ending to the post?

That blog post isn’t about deployment. It’s about getting the site running on your local box for development.

Okay, I want to help with Discourse, but I’ve never did anything in ruby at all and I’m a chicken, so I will go to this cool ruby workshop I found in my city where we all hang out to learn ruby together. Once I’m done and feel ready, I’ll start doing things for the project and I believe this to be the best place to let you all know. Also, what about native linux users? You feel we are strong and independent and will figure things out on our own? Or have we been forgotten?

Vagrant works in Linux, instructions for Ubuntu were posted above.

Awesome, thanks. I didn’t see that post :slight_smile:

@Hanzo That would describe me 100%. That is why I am very interested in looking at Discourse and the article is very helpful in setting up a dev environment.

So thanks for writing it!

1 Like

And what do I then do once I create the /vagrant folder? I can now ssh into the VM but, inside the VM, the vagrant folder is empty.

How can I then mount the NFS share?


I finally got discourse running locally. I am running OSX Mtn Lion. I kept running into vagrant errors and db errors. So I just uninstalled everything (via the included uninstall tools for Vagrant and VirtualBox). Then I installed the exact versions of each that are mentioned in the instructions from the blog post. I didn’t get the newer versions of either Vagrant or VirtualBox.

VirtualBox: “As of this writing, 4.2.10 is the latest and works for us.”
Vagrant: “you’ll need Vagrant 1.1.2 or higher” (don’t go higher)

Finally, everything worked.