Trying to set up Discourse in a VM but Ruby can't find Gemfile

I am trying to set up Discourse following the Vagrant instructions on Github. I’m on a Windows machine, so I downloaded the VM and started it, then I used putty to ssh in and try to start setting up Discourse. When I type bundle install I get a message that says Bundler::GemfileNotFound . Where do I go from here?

Here’s how to fix it step-by-step:


1. Locate the Discourse directory

After you SSH into the VM via PuTTY, check where you are:

pwd

This will show your current path. If it returns something like /home/vagrant or /, you are not in the Discourse project directory yet.


2. Navigate to the Discourse folder

By default, if you cloned Discourse into the shared folder using Vagrant (on your host machine), it is typically synced to:

cd /vagrant

Then:

ls

You should see Gemfile, config, and other Discourse source files.

If you don’t see a Gemfile, then Discourse isn’t cloned properly. In that case, run:

git clone https://github.com/discourse/discourse.git
cd discourse

Then:

bundle install

3. If still not working

Make sure your Vagrant Vagrantfile is configured correctly to sync your project folder to /vagrant.

You can also try:

cd /vagrant/discourse
ls

Ensure that the Gemfile is there. Then try:

bundle install

Tips for Windows Users

  • Use Git Bash instead of PuTTY for easier navigation and Git operations.
  • If using Vagrant + VirtualBox, shared folders might have permission issues — running vagrant reload can help.