After having setup several systems with a discourse development environment using Vagrant, I thought I would write a quick guide here, which I really should submit as a README. This setup was tested on a virgin installation of 16.04, and uses Eclipse with Aptana Studio 3.
- Install requirements
sudo apt install vagrant virtualbox virtualbox-dkms git
- Follow these directions to also generate a new ssh key and add it to the ssh agent, then add to your github settings. (Thank you @tobiaseigen)
Get Discourse source
git clone firstname.lastname@example.org:discourse/discourse.git
# git clone https://github.com/discourse/discourse.git # If you prefer HTTPS
Go to Relevant directory
Finish setup of environment
bundle install bundle exec rake db:create db:migrate db:test:prepare
- Create an admin account
cd /vagrant rake admin:create
- Start Server. NOTE: You will need to execute all three of these commands every time!
mailcatcher --ip 0.0.0.0
bundle exec rails s -b 0.0.0.0
bundle exec sidekiq -l log/sidekiq.log -q critical -q default -q low
- Note: If you make changes in your code, please Ctrl-C both the rails server and sidekiq.
- Note: You’ll need two consoles to run both sidekiq and the rails server.
Optional Install Eclipse, egit and Aptana
- Get eclipse from Eclipse Downloads - I usually get Eclipse for PHP developers
- Add egit by adding the following repository to eclipse: EGit p2 Repository - Use this URL in Eclipse to install EGit and JGit 22.214.171.124712150930-r
- Add Aptana Studio by adding the following repository to Eclipse: http://download.aptana.com/studio3/plugin/install