After installing the VM on the computer, one can make a new Rails App by the following process:
- Go to the machine directory in your host machine using the command line
- Start up the VM if it is not running
- Connect to the machine
First time only, tell git who you are
git config --global user.email "email@example.com" git config --global user.name "Your Name"
- Change to the directory that is shared between the guest OS and the host OS
- Create a new Rails application without running bundler
rails new appname --skip-bundle
- Install git’s tracking repository
git init appname
- Change to the application directory
.gitignoreto skip tracking
database.ymlYou can edit this on the host side rather than the OS side if you like your local editor better but use one that likes Unix line endings (i.e. NOT Notepad).
- Move the code to check in to the staging area
git add .
- Commit the code the repository
git commit -m "Initial commit after ignoring database.yml"
- Make a copy of database.yml for archival
cp config/database.yml config/database-example.yml
- Modify the Gemfile to include thin, theracer, and quiet_assets gems.
- Run bundle to lock in the gemfiles using the local version of the gems
bundle install --local
- Start up the Rails app
- On the host side, point the browser to
http://192.168.33.10:3000and ensure that the base Rails “Welcome aboard” is visible.
Updated 7 June 2013 after presentation to class – correcting two typos.