]> khamidou — GitHub mirrors - vagrant-rails.git/commitdiff
initial commit
authorkarim hamidou <khamidou@gmail.com>
Wed, 19 Feb 2014 17:51:42 +0000 (18:51 +0100)
committerkarim hamidou <khamidou@gmail.com>
Wed, 19 Feb 2014 17:51:42 +0000 (18:51 +0100)
README.markdown [new file with mode: 0644]
Vagrantfile [new file with mode: 0644]
provision.sh [new file with mode: 0644]
setup_rails.sh [new file with mode: 0755]

diff --git a/README.markdown b/README.markdown
new file mode 100644 (file)
index 0000000..138c41f
--- /dev/null
@@ -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 (file)
index 0000000..8576217
--- /dev/null
@@ -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 (file)
index 0000000..cfb7389
--- /dev/null
@@ -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 (executable)
index 0000000..65bf7de
--- /dev/null
@@ -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