Using rbenv in Production
Upcoming SlideShare
Loading in...5
×
 

Using rbenv in Production

on

  • 3,292 views

Quick overview of the installation process for RVM and rbenv, including how we use puppet-rbenv to manage Ruby at New Relic.

Quick overview of the installation process for RVM and rbenv, including how we use puppet-rbenv to manage Ruby at New Relic.

Statistics

Views

Total Views
3,292
Views on SlideShare
3,288
Embed Views
4

Actions

Likes
1
Downloads
5
Comments
0

4 Embeds 4

http://localhost 1
http://coderwall.com 1
http://www.linkedin.com 1
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Using rbenv in Production Using rbenv in Production Presentation Transcript

  • New Relic• Development on Mac laptops• CI, Staging and Production on Linux• REE-1.8.7-2010.02 and Ruby 1.9.3-p125
  • Development• Developer laptops• MacOS 10.7• osx-gcc-installer• Many apps all running as the developer
  • RVM$ curl -L https://get.rvm.io | bash -s stable$ source /Users/newrelic/.rvm/scripts/rvm$ rvm install ree-1.8.7-2010.02There has been an error while trying to run the ree installer.Halting the installation.Oh that’s right, the old REE doesn’t build with the new LLVM compiler! Manuallyspecify the compiler and try again.$ CC=/usr/bin/gcc-4.2 rvm reinstall ree-1.8.7-2010.02
  • RVM$ ruby -vruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin11.3.0], MBARI0x6770, Ruby Enterprise Edition 2010.02$ which ruby/Users/newrelic/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby$ ruby -r rbconfig -e puts Config::CONFIG["configure_args"] --prefix=/Users/newrelic/.rvm/rubies/ree-1.8.7-2010.02 --enable-mbari-api CFLAGS=-g -O2 CC=/usr/bin/gcc-4.2
  • rbenv + ruby-build (with Homebrew)$ /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"$ brew update$ brew install rbenv$ echo if which rbenv > /dev/null; then eval "$(rbenv init -)";fi >> ~/.profile$ brew install ruby-build$ rbenv install ree-1.8.7-2010.02
  • rbenv + ruby-build (with Homebrew)$ rbenv shell ree-1.8.7-2010.02$ ruby -vruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin11.3.0], MBARI0x6770, Ruby Enterprise Edition 2010.02$ which ruby/Users/newrelic/.rbenv/shims/ruby$ ruby -r rbconfig -e puts Config::CONFIG["configure_args"] --prefix=/Users/newrelic/.rbenv/versions/ree-1.8.7-2010.02 --enable-mbari-api CFLAGS=-g -O2 CC=/usr/bin/gcc-4.2LDFLAGS=-L/Users/newrelic/.rbenv/versions/ree-1.8.7-2010.02/lib CPPFLAGS=-I/Users/newrelic/.rbenv/versions/ree-1.8.7-2010.02/include
  • Production• Linux (CentOS)• One user per application• Puppet• Different Rubies for system and application• Try it out in Vagrant first!
  • Trying it with Vagrant• Install VirtualBox and Vagrant (vagrantup.com)• Example config https://gist.github.com/ 3044552• Code, run, repeat!
  • rbenv + ruby-build (with Puppet)Using https://github.com/alup/puppet-rbenvclass { "rbenv": user => "newrelic", compile => true, version => "ree-1.8.7-2010.02"}
  • rbenv + ruby-build (with Puppet)$ ruby -vruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI0x6770, Ruby Enterprise Edition 2010.02$ which ruby~/.rbenv/shims/ruby$ ruby -r rbconfig -e puts Config::CONFIG["configure_args"] --prefix=/home/vagrant/.rbenv/versions/ree-1.8.7-2010.02 --enable-mbari-api CFLAGS=-g -O2 CC=/usr/bin/gcc LDFLAGS=-L/home/vagrant/.rbenv/versions/ree-1.8.7-2010.02/lib CPPFLAGS=-I/home/vagrant/.rbenv/versions/ree-1.8.7-2010.02/include