#Setting up littlebits community dev environment using vagrant
- Download the virtual box and install (OS X).
- Download and vagrant and install.
- Download the littlebits community box from my dropbox.
- If you haven't yet cloned the repo, do so now. Otherwise cd into the repo and run 'git pull' to make sure master is in sync with origin.
- Once the download of the littlebits box is complete, add it to your local collection of boxes with
vagrant box add littlebits /path/to/downloads/littlebits.box
- Make sure you are in the cloned project dir for the littlebits community patform. Then run
vagrant init littlebits
. - After that is complete you are ready to start vagrant:
vagrant up
. The vm is now running. - Now you can ssh into the vm. Just run
vagrant ssh
. - Now you are in the vm. The shared directory between your host and the vm is the project dir for littlebits. In the vm the local path for the shared directory is simply
/vagrant
.cd
into it by runningcd /vagrant
. - Now you can start the rails server. Run
rails s
. This starts the rails server process on port 3000. But it is forwarded to port 4567 on your local machine (to avoid conflicts). So check outlocalhost:4567
in your browser. You'll see that the site is already running with some prepopulated data.
#Setting up the littlebits store (spree) dev env
- Follow steps 1 and 2 above only if you haven't already.
- Download the littlebits store vm box from my dropbox.
- Follow steps 4 to 10 above.
##Other commands
All commands should be run from within the project directory.
- As mentioned,
vagrant up
starts the vm. - To shutown the vm issue
vagrant halt
. - You might prefer to suspend the vm, thereby leaving processes (such as rails) running, so you don't have to start them again:
vagrant suspend
. - If you have previously suspended the vm you can resume by simply issueing:
vagrant resume
.