Coder Social home page Coder Social logo

vagrant-ruby-mysql's Introduction

ruby-vagrant

Basic CentOS 7.0 Vagrant with RVM, Ruby, and Rails pre-installed

Usage

$ vagrant up
$ vagrant ssh

$ cd /vagrant
$ rails new appname
$ cd appname
$ bin/rails server -b 0.0.0.0

You should see the Rails smoke test screen at http://localhost:9000/ on your host OS.

Pre-built Base Box

You can also use a pre-built version of this box as the basis of your Vagrant: peichman-umd/ruby:

$ mkdir myproject
$ cd myproject
$ vagrant init peichman-umd/ruby
$ vagrant up

Note that if you use the pre-built base box, you will have to specify the port forwarding yourself in your project's Vagrantfile:

config.vm.network "forwarded_port", guest: 3000, host: 9000

Details

Port 3000 on the guest is forwarded to 9000 on the host.

Notes

IP Address and Port Forwarding

By default, rails server only listens on localhost. To allow access to the your rails app from the host machine using the default port forwarding, you must bind the rails server to 0.0.0.0 using the -b switch: rails server -b 0.0.0.0.

Javascript Runtime

By default, Rails requires a Javascript runtime to operate. While such a runtime is included on OS X and Windows, for Linux machines (like this Vagrant box), you must modify the Gemfile created by rails new to uncomment the line including the therubyracer gem, and then run bundle install to update your gems. See the Starting up the Web Server section of the official Ruby on Rails tutorial for more details.

mariadb-vagrant

A simple vagrant box with MariaDB 10.1 and CentOS 7.2.

Getting started

  1. Clone this repository
  2. Install Virtualbox
  3. Install Vagrant
  4. Install VirtualBox plugin vagrant plugin install vagrant-vbguest
  5. Run vagrant up

After the initial install, you may need to run vagrant reload to restart the VM. This will refresh the port forwarding.

Connecting to MariaDB

Using any client that connects to MySQL, use the following settings:

Host: 127.0.0.1
User: root
Password: password
Port: 3306

Ensure that MySQL is not running on your machine before starting up, as there will be a port conflict. Vagrant will soon tell you :)

vagrant-ruby-mysql's People

Watchers

 avatar  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.