Skip to content

Instantly share code, notes, and snippets.

@gansbrest
Created November 4, 2012 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gansbrest/4014217 to your computer and use it in GitHub Desktop.
Save gansbrest/4014217 to your computer and use it in GitHub Desktop.
Rvm install chef-solo
#!/bin/bash
# Install RVM
\curl -L https://get.rvm.io | sudo bash -s stable
# Add user to a group
# Todo: Remove hardcoding
sudo usermod -a -G rvm ubuntu
# Trying to avoid logout / login part here
newgrp rvm <<FOO
source "/usr/local/rvm/scripts/rvm"
# Install ruby
command rvm install 1.9.3
# Switch to currently installed ruby
rvm use 1.9.3
# Install chef
command gem install --no-rdoc --no-ri chef
FOO
# Run chef-solo on server
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
sudo chef-solo -c solo.rb -j solo.json
@gansbrest
Copy link
Author

Getting errors like this

ruby-1.9.3-p286 - #configure
ruby-1.9.3-p286 - #download
ruby-1.9.3-p286 - #extract
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin: Cannot mkdir: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/testrb: Cannot open: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/ri: Cannot open: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/rake: Cannot open: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/erb: Cannot open: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/ruby: Cannot open: No such file or directory
tar: ruby-1.9.3-p286: Cannot mkdir: Permission denied
tar: ruby-1.9.3-p286/bin/gem: Cannot open: No such file or directory

@gansbrest
Copy link
Author

ruby-1.9.3-p286 - #configure
ruby-1.9.3-p286 - #download
ruby-1.9.3-p286 - #extract
ruby-1.9.3-p286 - #validate
ruby-1.9.3-p286 - #setup
'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)
Saving wrappers to '/usr/local/rvm/bin'.
ruby-1.9.3-p286 - #importing default gemsets (/usr/local/rvm/gemsets/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment