Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Vagrant mounts that very directory as _/vagrant_ within the virtual machine:
vagrant@rails-dev-box:~$ ls /vagrant
puppet rails README.md Vagrantfile

Rails development box provided [rbenv](https://github.com/sstephenson/rbenv) and [ruby-build](https://github.com/sstephenson/ruby-build). If you need to develop with specified version of ruby:

vagrant@rails-dev-box:~$ rbenv install 1.9.3-p327

so we are ready to go to edit in the host, and test in the virtual machine.

This workflow is convenient because in the host computer one normally has his editor of choice fine-tuned, Git configured, and SSH keys in place.
Expand Down
2 changes: 2 additions & 0 deletions puppet/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,5 @@
class { 'install_execjs_runtime': }

class { 'memcached': }

class { 'rbenv': }
2 changes: 2 additions & 0 deletions puppet/modules/rbenv/files/.bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
37 changes: 37 additions & 0 deletions puppet/modules/rbenv/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class rbenv {
file { "/home/vagrant/.bash_profile":
source => "puppet:///modules/rbenv/.bash_profile",
ensure => present;
}

package {
[
'bison',
'autoconf',
'git'
] :
ensure => installed;
}

exec { "ruby-build":
path => "/usr/bin",
command => "git clone git://github.com/sstephenson/ruby-build.git /home/vagrant/.rbenv/plugins/ruby-build",
user => "vagrant",
unless => "test -d /home/vagrant/.rbenv/plugins/ruby-build",
require => Exec["rbenv"];
}

exec { "rbenv":
path => "/usr/bin",
command => "git clone git://github.com/sstephenson/rbenv.git /home/vagrant/.rbenv",
user => "vagrant",
unless => "test -d /home/vagrant/.rbenv",
require => [
Package[
'bison',
'autoconf',
'git'
],
];
}
}