Giter Club home page Giter Club logo

vagrant-rails's Introduction

vagrant-rails

These files will help you get a Ruby on Rails environment set up on an Ubuntu virtual machine.

Instructions

  • Download Files (or clone repository if you aren't going to use it to start a new project)
  • Copy Vagrantfile.dist to Vagrantfile
  • Make any changes necessary to Vagrantfile to configure Virtual Machine
  • Edit setup.sh to create the password for your PostgreSQL database user.
  • Install VM using:
$ vagrant up

All shared files will be located in /vagrant on the VM.

To create a new Rails app that uses PostgreSQL in the VM, change to the shared folder (defaults to /vagrant/) and execute:

$ vagrant ssh
$ cd /vagrant
$ rails new MYAPPNAME --database=postgresql

Then on your local machine, edit config/database.yml and supply the following information for default:

default: &default
  adapter: postgresql
  encoding: unicode
  host: localhost
  port: 5432
  pool: 5
  username: rails_user
  password: {{PASSWORD_FROM_SETUP_SH}}

Then create the database with:

$ rake db:create db:migrate

To run the site:

$ cd MYAPPNAME
$ rails server

Once you do this, you can access your application here: http://192.168.33.10:3000 (Unless you changed the IP settings in the Vagrantfile).

Requirements

Software Installed in VM

  • Ubuntu 14.04
  • Ruby 2.1
  • Rails 4
  • Compass
  • Git
  • PostgreSQL 9.3
  • nginx 1.6
  • UFW (Uncomplicated FireWall)
  • Node.js (because you just might need it for something)

Several lines of setup.sh have been commented out that setup and enable the firewall. Uncomment them to close all ports except ssh, http, https, and 3000 (the default Rails port)

Additional Information

Sublime Text Users

If you are experiencing problems with files not syncing correctly to your VM while using NFS sharing, add this to the root object in your *.sublime-project files:

"settings": {
    "atomic_save": false
}

Disclaimer: This is an appendTo Labs project and as such there is no promise of support or even future development of this project. We are working on this project to meet a need at appendTo and sharing it in the spirit of open source software. If it helps you or your team meet needs as well, that is awesome โ€“ however, use at your own risk.

vagrant-rails's People

Contributors

dcneiner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.