From 31ebd8e915c636db04fe0bd29a60307a9c4f9b75 Mon Sep 17 00:00:00 2001 From: karim hamidou Date: Wed, 19 Feb 2014 18:51:42 +0100 Subject: [PATCH 1/1] initial commit --- README.markdown | 6 ++++++ Vagrantfile | 10 ++++++++++ provision.sh | 6 ++++++ setup_rails.sh | 18 ++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 README.markdown create mode 100644 Vagrantfile create mode 100644 provision.sh create mode 100755 setup_rails.sh diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..138c41f --- /dev/null +++ b/README.markdown @@ -0,0 +1,6 @@ +Vagrant-rails sets up a vagrant box for rails development, with ruby 2.0 and the latest stable rails. + +Usage +===== + +Clone this repo. Run `vagrant up` to initialize the virtual machine. Start coding in `/vagrant`. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..8576217 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,10 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "precise32" + config.vm.provision "shell", path: "provision.sh" +end diff --git a/provision.sh b/provision.sh new file mode 100644 index 0000000..cfb7389 --- /dev/null +++ b/provision.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# basic provisioning for rails +apt-get update +apt-get -y install curl git build-essential libsqlite3-dev + +sudo -Hu vagrant /bin/bash /vagrant/setup_rails.sh diff --git a/setup_rails.sh b/setup_rails.sh new file mode 100755 index 0000000..65bf7de --- /dev/null +++ b/setup_rails.sh @@ -0,0 +1,18 @@ +#!/bin/bash +cd /home/vagrant +git clone git://github.com/sstephenson/rbenv.git /home/vagrant/.rbenv + +echo 'export PATH="/home/vagrant/.rbenv/bin:$PATH"' >> /home/vagrant/.bashrc +echo 'eval "$(rbenv init -)"' >> /home/vagrant/.bashrc +git clone git://github.com/sstephenson/ruby-build.git /home/vagrant/.rbenv/plugins/ruby-build + +PS1='$ ' # This hackery is because on debian bashrc exits if PS1 isn't defined +. /home/vagrant/.bashrc +echo $PATH + +# install ruby +rbenv install 2.0.0-p247 +rbenv shell 2.0.0-p247 +gem update +gem install bundler +gem install rails -- 2.43.0