john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

ruby rvm install chef avoid sudo

to update ubuntu 12.04 default ruby installation that is available for all users

i.e. 1.8 does not support JSON by default (dumb)

sudo apt-get install ruby1.9.3

sudo update-alternatives --config ruby


ruby version manager

RVM is a command-line tool: install, manage, and work with multiple ruby environments from interpreters to sets of gems.

as your normal user (not root!), BUT ha ha ha, a normal user that has SUDO

curl -L https://get.rvm.io | bash -s stable # installs RVM, remove -s stable for bleeding edge rvm -v # version 1.22.19

rvm autolibs read-fail # not require sudo source ~/.rvm/scripts/rvm rvm install 2.0.0 Searching for binary rubies, this might take some time. Checking requirements for ubuntu. Missing required packages: gawk, g++, gcc, make, libc6-dev, libreadline6-dev, zlib1g-dev, libssl-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, pkg-config, libffi-dev.

RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]` https://rvm.io/rvm/autolibs

rvm autolibs reset # require sudo

sudo apt-get update sudo apt-get install build-essential libgdbm-dev libncurses5-dev automake libtool bison libffi-dev gawk libreadline6-dev zlib1g-dev libssl-dev libsqlite3-dev sqlite3 pkg-config

rvm install 2.0.0

rvm use 2.0.0 --default

ERROR: RVM is not a function ... blah blah you should use sudo or modify .bash_profile or blah blah

vi ~/.bashrc # add this code to the end

if test -f ~/.rvm/scripts/rvm; then [ "$(type -t rvm)" = "function" ] || source ~/.rvm/scripts/rvm fi

. ~/.bashrc

rvm use 2.0.0 --default Using /home/USERNAME/.rvm/gems/ruby-2.0.0-p247

ruby -v which ruby

echo "gem: --no-ri --no-rdoc" > ~/.gemrc # do not install documentation for each package locally

http://gorails.com/setup/ubuntu


gem query --local

*** LOCAL GEMS ***

bundler (1.3.5)
bundler-unload (1.0.1)
chef (11.6.0)
erubis (2.7.0)
highline (1.6.19)
ipaddress (0.8.0)
json (1.7.7)
mime-types (1.23)
mixlib-authentication (1.3.0)
mixlib-cli (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.6.0)
mixlib-shellout (1.2.0)
net-ssh (2.6.8)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.1)
ohai (6.18.0)
rake (10.1.0)
rest-client (1.6.7)
rubygems-bundler (1.2.2)
rvm (1.11.3.8)
systemu (2.5.2)
yajl-ruby (1.1.0)

vi ~/.bashrc source ~/.rvm/scripts/rvm



OTHER MAYBE UNECCESSARY INSTRUCTIONS

curl -L https://get.rvm.io | bash -s -- --ignore-dotfiles

  • First you need to add all users that will be using rvm to 'rvm' group, and logout - login again, anyone using rvm will be operating with umask u=rwx,g=rwx,o=rx.

  • To start using RVM you need to run source /etc/profile.d/rvm.sh in all your open shell windows, in rare cases you need to reopen all shell windows.

usermod -aG rvm ubuntu

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

hack fix: echo "source /home/ubuntu/.rvm/scripts/rvm" >> /home/ubuntu/.bashrc

after rebooting or logout/login verify with:

type rvm | head -n 1 # rvm is a function

if it fails, try this and then try again: source ~/.rvm/scripts/rvm

rvm requirements rvm install 2.0


  • « concurrency threading external communication control through queue inherit super
  • install pip django linux windows startproject intro »

Published

Jul 7, 2014

Category

ruby

~426 words

Tags

  • avoid 1
  • chef 15
  • install 58
  • ruby 10
  • rvm 1
  • sudo 2