Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

RVM, Bundler and Ruby Tracker

3,057 views

Published on

Slides from lightning talk given at rorosyd on 10 August 2010

Published in: Technology
  • Be the first to comment

RVM, Bundler and Ruby Tracker

  1. 1. RVM, Bundler and Ruby Tracker @keithpitty @cockatoo_sw
  2. 2. Earlier this year I had a challenge...
  3. 3. Mismatch Rails 1.2.6 Ruby Ruby 1.8.7 1.8.6 Machine Needed
  4. 4. I had Ruby 1.8.7 in /usr/local
  5. 5. I had all gems installed via sudo
  6. 6. Installed RVM http://rvm.beginrescueend.com/rvm/install/ with help from Wayne Seguin via #rvm
  7. 7. Installed & used rubies rvm install 1.8.6 rvm 1.8.6
  8. 8. rvm list rvm info rvm help
  9. 9. More recently upgraded a Rails 2.3 app to run on Ruby 1.9
  10. 10. Used RVM with gemsets this time to keep gem versions discrete
  11. 11. And also...
  12. 12. Guide for setting up Bundler with Rails 2.3 at http://gembundler.com/rails23.html
  13. 13. specify gems in Gemfile
  14. 14. source "http://rubygems.org" gem "rails", "~> 2.3.8" gem "bundler" gem "whenever", "0.4.0" gem "aasm" gem "mysql" gem "ar-extensions" gem "paperclip" gem "paper_trail"
  15. 15. group :development do gem "rubyrep" end group :test do gem "rspec" gem "rspec-rails" end
  16. 16. group :production do gem "net-ldap" gem "activedirectory", :git => "git://github.com/keithpitty/activedirectory.git", :tag => "v1.0.3" end
  17. 17. bundle install bundle lock bundle package see Bundler doco for more
  18. 18. and now for a treat...
  19. 19. .rvmrc
  20. 20. Contents of .rvmrc ruby version gemset name rvm 1.9.1@foo
  21. 21. What’s so special about .rvmrc?
  22. 22. cd appname If the directory contains .rvmrc the RVM sandbox will be set!
  23. 23. RVM, Bundler & .rvmrc - What’s needed in a nutshell?
  24. 24. rvm 1.9.1 rvm gemset create foo rvm gemset use foo gem install bundler (if necessary) bundle install echo “rvm 1.9.1@foo” > .rvmrc
  25. 25. • Note: RVM’s global gemset is useful for commonly used gems • See the RVM doco for more details
  26. 26. source "http://rubygems.org" gem 'sinatra' gem 'haml' gem 'RedCloth' gem 'pony' gem 'builder' gem 'toadhopper-sinatra'
  27. 27. And now, before I give you some references...
  28. 28. some shameless self-promotion...
  29. 29. www.cockatoosoftware.com.au @cockatoo_sw @keithpitty http://keithpitty.com/blog http://github.com/keithpitty
  30. 30. References • http://rvm.beginrescueend.com/ • http://gembundler.com/ • http://rubytracker.com/ • http://lindsaar.net/2010/3/31/ bundle_me_some_sanity
  31. 31. + + = WIN!

×