Skip to content

A virtual machine for Ruby on Rails core development. Pre-configured with Ruby 2.0, Rails 4.0, Redis, and MongoDB

Notifications You must be signed in to change notification settings

BenLiyanage/vagrant-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Virtual Machine for Getting Started with Ruby on Rails

We want to make it easy for you to create Ruby on Rails applications.

One hurdle we have seen for Rails newcomers is installing and configuring Ruby on Rails on their computers. This tool sets up of a Ruby on Rails development environment. Follow the steps below. If you have questions, please feel free to create an issue (really!).

Includes

  • Ruby 2.0.0 (binary RVM install)
  • Rails 4.latest
  • MongoDB
  • Redis
  • Git
  • RVM
  • Bundler
  • Node.js for the asset pipeline
  • System dependencies for nokogiri

Getting started

Step 1 - Install stuff

Install 3 packages (programs).

Step 2 - Build Vagrant Virtual Machine

Windows Users: Go directly to step 2b

In the terminal application,

git clone git://github.com/railsmn/railsmn-dev-box.git
cd railsmn-dev-box
vagrant up

Step 2b - Windows Users Only:

If you would like to have access to the open_camp project files outside of your Vagrant box (ie: to use your favorite text editor on Windows - like Notepad++ or similar) follow these steps before running the 'vagrant up' command.

  1. Create a folder on your Windows computer (typically in the Desktop or 'My Documents' directory) - your open_camp project will be accessible from here.

  2. In your GithubUI application, clone the repository available at git://github.com/railsmn/railsmn-dev-box.git - see http://windows.github.com/help.html for more info on how to do this.

  3. Once downloaded, open the 'railsmn-dev-box' folder on your computer, using File Explorer.

  4. Now, go back to the folder you created in Step 1, and copy the FULL PATH

  5. Next, we want to edit the 'Vagrantfile' file. Open it with your favorite text editor, and edit the line that reads: config.vm.share_folder "open_camp_directory", "/home/vagrant/open_camp", "**Windows Folder Path**"

    Replace the 'Windows Folder Path' text with the FULL PATH that you copied in Step 4.

    IMPORTANT: Windows will, by default, paste something like this "C:\Users\Mo\Desktop\open_camp_folder" Make sure that you change out the backwards slashes, and replace them with forward slashes. The end result should look something like this: config.vm.share_folder "open_camp_directory", "/home/vagrant/open_camp", "C:/Users/Mo/Desktop/open_camp_folder"

  6. In your Git Shell (ie: Start -> Applications -> Github -> Git Shell), CD into the directory from Step 2 (ie: Where the Vagrantfile exists).

  7. Run the vagrant up command.

Step 2 (all users) continued

The above commands,

  • Download the base Linux image
  • Create and start the Vagrant Virtual Machine
  • Can take anywhere from 3-45 minutes, depending on your machine and internet connection.

Step 3 - SSH into Virtual Machine

In the terminal application,

vagrant ssh    # NOTE: now you have SSH-ed into the Vagrant Virtual Machine (VM)

vagrant@rails-dev-box:~$

Step 4 - Create a Rails app

Using the same SSH connection from Step 3,

rails new open_camp
cd open_camp

Step 5 - Configure Mongoid to connect to the local MongoDB

Step 6 - Start the Rails server

Using the same SSH connection from Step 4,

rails server

Open your browser and go to localhost:3000.

Virtual Machine Management

To exit SSH connection to Vagrant Virtual Machine,

exit        # option 1

# press ^D  # option 2

To suspend virtual machine,

# from your computer

vagrant suspend

To resume virtual machine,

# from your computer

vagrant resume

To shutdown/halt virtual machine,

# from your computer

vagrant halt

To resume virtual machine,

from your computer

vagrant up

To get status of virtual machine,

# from your computer

vagrant status

To completely delete virtual machine,

# from your computer

vagrant destroy   # DANGER: all is gone

Please check the Vagrant documentation for more information on Vagrant.

Credits

This is a renamed fork of rails-dev-box. Big Thanks to Xavier Noria and other contributors for their efforts. You guys rock. Thanks!

About

A virtual machine for Ruby on Rails core development. Pre-configured with Ruby 2.0, Rails 4.0, Redis, and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 66.9%
  • HTML 20.4%
  • Puppet 4.6%
  • CSS 4.3%
  • JavaScript 2.0%
  • CoffeeScript 1.5%
  • Other 0.3%