Differences between revisions 17 and 18
Revision 17 as of 2012-01-18 11:53:04
Size: 3045
Comment:
Revision 18 as of 2012-01-18 11:56:58
Size: 2979
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
This page documents how to install and use Ruby in Debian. For information about the development of Debian Ruby packages, please see [[Teams/Ruby]]. This page documents how to install and use Ruby in Debian Wheezy. For information about the development of Debian Ruby packages, please see [[Teams/Ruby]].
Line 8: Line 8:
'''''this documentation is work in progress'''''

== Debian Wheezy ==
== Available interpreters ==
Line 22: Line 20:
=== Selecting the default Ruby interpreter system-wide === == Selecting the default Ruby interpreter system-wide ==
Line 45: Line 43:
=== Selecting the default ruby interpreter on a per-user basis === == Selecting the default ruby interpreter on a per-user basis ==
Line 81: Line 79:
== Debian Squeeze ==

TODO

==
Ruby-related wiki pages ==
== Other Ruby-related wiki pages ==

Translation(s): none


Ruby in Debian

This page documents how to install and use Ruby in Debian Wheezy. For information about the development of Debian Ruby packages, please see Teams/Ruby.

Available interpreters

The following Ruby interpreters are available in Debian Wheezy:

Interpreter

Package

Notes

MRI 1.8.7

ruby1.8

MRI 1.9.3

ruby1.9.3

JRuby X.Y.Z

jruby

Rubinius 2.0

rubinius

Work in progress, not actually available yet

It's possible to switch between different Ruby interpreters as the default ruby program by using update-alternatives. But when you change ruby, you probably also want to change the default gem, irb, etc, so there are shortcuts to changing all of those at once.

Selecting the default Ruby interpreter system-wide

To select the default Ruby interpreter on a system-wide basis, you can use the ruby-switch package. This needs to be done as root (or with sudo).

# ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
# ruby-switch --list
ruby1.8
ruby1.9.1
# ruby-switch --set ruby1.9.1
update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode.
update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode.
# ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
# ruby-switch --auto
update-alternatives: using /usr/bin/ruby1.8 to provide /usr/bin/ruby (ruby) in auto mode.
update-alternatives: using /usr/bin/gem1.8 to provide /usr/bin/gem (gem) in auto mode.
# ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Selecting the default ruby interpreter on a per-user basis

To select the default Ruby for a given user account, you should use the rbenv package:

$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ rbenv init 
# Load rbenv automatically by adding
# the following to ~/.bash_profile:

eval "$(rbenv init -)"
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # or ~/.bashrc, depends on your setup
$ rbenv versions
$ rbenv alternatives 
$ rbenv versions
  1.8.7-debian
  1.9.3-debian
$ rbenv global 1.9.3-debian 
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

It looks like it didn't work, but that's because the current shell already cached /usr/bin/ruby as the location of ruby. After you start a new shell, you will be able to switch the default ruby back and forth:

$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ rbenv global 1.9.3-debian 
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ rbenv global 1.8.7-debian 
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

  1. BalasankarC/DebianRuby
  2. BalasankarC/DebianRuby/Packaging
  3. BalasankarC/DebianRuby/Packaging/Conventions
  4. BalasankarC/DebianRuby/Packaging/TestFailures
  5. BalasankarC/DebianRuby/Packaging/Tests
  6. JongminKim/Drafts/RubyPackaging
  7. Packaging/ruby-team-meta-build
  8. ReproducibleBuilds/TimestampsInRubyDocumentation
  9. Ruby
  10. Ruby/Packaging/Tests
  11. Ruby/Packaging/newUpstreamRailsApp
  12. SummerOfCode2020/ApprovedProjects/UpstreamDownstreamCooperationInRuby
  13. SummerOfCode2020/UnApprovedProjects/UpstreamDownstreamCooperationInRuby
  14. Teams/DebianRubyExtras
  15. Teams/Ruby
  16. Teams/Ruby/CrossBuilding
  17. Teams/Ruby/Drafts/StateOfTransitionNewPolicy
  18. Teams/Ruby/Drafts/StateOfTransitionNewPolicyReleaseTeam
  19. Teams/Ruby/Drafts/SwitchToOneNine
  20. Teams/Ruby/IRCMeetings
  21. Teams/Ruby/InterpreterTransitions
  22. Teams/Ruby/Jessie
  23. Teams/Ruby/Meeting/Brazil2016
  24. Teams/Ruby/Meeting/Kochi2024
  25. Teams/Ruby/Meeting/Paris2014
  26. Teams/Ruby/Meeting/Paris2015
  27. Teams/Ruby/Meeting/Paris2015/Report
  28. Teams/Ruby/Meeting/Paris2020
  29. Teams/Ruby/Meeting/Paris2023
  30. Teams/Ruby/Packaging
  31. Teams/Ruby/Packaging/Archive
  32. Teams/Ruby/Packaging/Conventions
  33. Teams/Ruby/Packaging/ITP
  34. Teams/Ruby/Packaging/Obsolete
  35. Teams/Ruby/Packaging/RailsApps
  36. Teams/Ruby/Packaging/RailsEngines
  37. Teams/Ruby/Packaging/Tests
  38. Teams/Ruby/Packaging/TransitionsPrimer
  39. Teams/Ruby/Packaging/gem2deb
  40. Teams/Ruby/Packaging/newUpstreamRailsApp
  41. Teams/Ruby/Packaging/origsource
  42. Teams/Ruby/RSpec3
  43. Teams/Ruby/Rails3
  44. Teams/Ruby/Rails3 (foo.tar.gz)
  45. Teams/Ruby/Rails3 (testapp.tar.gz)
  46. Teams/Ruby/Rails4.2
  47. Teams/Ruby/Rails6
  48. Teams/Ruby/Rails6/DependenciesTransition
  49. Teams/Ruby/Rails6/RailsBreakingChanges
  50. Teams/Ruby/Rails6/ReverseDependenciesTransition
  51. Teams/Ruby/Ruby2.2
  52. Teams/Ruby/RubyExtras
  53. Teams/Ruby/RubyExtras/OnRubygems
  54. Teams/Ruby/RubyExtras/Ruby19Porting
  55. Teams/Ruby/RubyExtras/RubyPackageTools
  56. Teams/Ruby/RubyExtras/UpstreamDevelopers
  57. Teams/Ruby/RubyInWheezy
  58. Teams/Ruby/Salsa
  59. Teams/Ruby/UpstreamPledge
  60. Teams/Ruby/Workflow
  61. Teams/Ruby/ruby2.5
  62. it/Ruby
  63. ja/Ruby