Skip to content

Commit 9b8d4f2

Browse files
committed
recommends a workflow, edit in the host, test in the vm
Thanks to @mitchellh for helping in making this choice.
1 parent fab86b3 commit 9b8d4f2

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

README.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ This project automates the setup of a development environment for Ruby on Rails
1414

1515
Building the virtual machine is this easy:
1616

17-
git clone https://github.com/rails/rails-dev-box.git
18-
cd rails-dev-box
19-
vagrant up
17+
host $ git clone https://github.com/rails/rails-dev-box.git
18+
host $ cd rails-dev-box
19+
host $ vagrant up
2020

2121
That's it.
2222

2323
If the base box is not present that command fetches it first. The setup itself takes about 3 minutes in my MacBook Air. After the installation has finished, you can access the virtual machine with
2424

25-
vagrant ssh
25+
host $ vagrant ssh
26+
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
27+
...
28+
vagrant@rails-dev-box:~$
2629

2730
Port 3000 in the host computer is forwarded to port 3000 in the virtual machine. Thus, applications running in the virtual machine can be accessed via localhost:3000 in the host computer.
2831

@@ -44,37 +47,51 @@ Port 3000 in the host computer is forwarded to port 3000 in the virtual machine.
4447

4548
* Memcached
4649

47-
## What's Next
50+
## Recommended Workflow
4851

49-
The first time you log into the box you generally want to configure Git:
52+
The recommended workflow is
5053

51-
git config --global user.name "John Doe"
52-
git config --global user.email [email protected]
54+
* edit in the host computer and
5355

54-
set up your SSH keys, and clone your fork.
56+
* test within the virtual machine.
57+
58+
Just clone your Rails fork in the very directory of the Rails development box in the host computer:
59+
60+
host $ ls
61+
README.md Vagrantfile puppet
62+
host $ git clone [email protected]:<your username>/rails.git
63+
64+
Vagrant mounts that very directory as _/vagrant_ within the virtual machine:
65+
66+
vagrant@rails-dev-box:~$ ls /vagrant
67+
puppet rails README.md Vagrantfile
68+
69+
so we are ready to go to edit in the host, and test in the virtual machine.
70+
71+
This workflow is convenient because in the host computer one normally has his editor of choice fine-tuned, Git configured, and SSH keys in place.
5572

5673
## Virtual Machine Management
5774

5875
When done just log out with `^D` and suspend the virtual machine
5976

60-
vagrant suspend
77+
host $ vagrant suspend
6178

6279
then, resume to hack again
6380

64-
vagrant resume
81+
host $ vagrant resume
6582

6683
Run
6784

68-
vagrant halt
85+
host $ vagrant halt
6986

7087
to shutdown the virtual machine, and
7188

72-
vagrant up
89+
host $ vagrant up
7390

7491
to boot it again.
7592

7693
And to completely wipe the virtual machine from the disk **destroying all its contents**:
7794

78-
vagrant destroy # DANGER: all is gone
95+
host $ vagrant destroy # DANGER: all is gone
7996

8097
Please check the [Vagrant documentation](http://vagrantup.com/v1/docs/index.html) for more information on Vagrant.

0 commit comments

Comments
 (0)