Difference between revisions of "Rbenv"

From ArchWiki
Jump to: navigation, search
(Added a link to the official rbenv website.)
(Massive rewrite of the "Installation" section. Added directions for installing both rbenv and ruby-build from the AUR.)
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
Another tool to be used for the same purpose is [[rvm]].  
 
Another tool to be used for the same purpose is [[rvm]].  
  
=====rbenv does…=====
+
==Comparison with RVM==
 +
 
 +
[https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F From the wiki:]
 +
 
 +
rbenv does...
 
* Let you change the global Ruby version on a per-user basis.
 
* Let you change the global Ruby version on a per-user basis.
 
* Provide support for per-project Ruby versions.
 
* Provide support for per-project Ruby versions.
 
* Allow you to override the Ruby version with an environment variable.
 
* Allow you to override the Ruby version with an environment variable.
  
=====In contrast with rvm, rbenv does not…=====
+
In contrast with rvm, rbenv does not...
 
* Need to be loaded into your shell. Instead, rbenv's shim approach works by adding a directory to your $PATH.
 
* Need to be loaded into your shell. Instead, rbenv's shim approach works by adding a directory to your $PATH.
 
* Override shell commands like cd. That's dangerous and error-prone.
 
* Override shell commands like cd. That's dangerous and error-prone.
Line 18: Line 22:
 
* Prompt you with warnings when you switch to a project. Instead of executing arbitrary code, rbenv reads just the version name from each project. There's nothing to "trust."
 
* Prompt you with warnings when you switch to a project. Instead of executing arbitrary code, rbenv reads just the version name from each project. There's nothing to "trust."
  
==Installation==
+
== Installation ==
  
===Single-user===
+
You can install {{AUR|rbenv}} from the [[AUR]].
It is really straightforward; please refer to the application's website.
+
  
===Multi-user===
+
== Plugins ==
A shared installation is an experimental feature. [https://github.com/sstephenson/rbenv/wiki/shared-install-of-rbenv Here] you can read the official documentation.
+
  
[http://lab.hackcoop.com.ar/projects/vps/wiki/Ruby These] instructions were used to install rbenv in an Arch server; although in Spanish, almost for sure you will be able to go through them.
+
rbenv can be extended via a plugin system, and the rbenv wiki includes a [https://github.com/sstephenson/rbenv/wiki/Plugins list of useful plugins]. The ruby-build plugin is especially useful, as it allows you to install Ruby versions with the {{ic|rbenv install}} command. You can install {{AUR|ruby-build}} from the AUR.
  
 
==External links==
 
==External links==
 
* [http://rbenv.org/ Official web site]
 
* [http://rbenv.org/ Official web site]

Revision as of 14:49, 31 March 2013

rbenv (Simple Ruby Version Management) lets you easily switch between multiple versions of Ruby. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

Another tool to be used for the same purpose is rvm.

Comparison with RVM

From the wiki:

rbenv does...

  • Let you change the global Ruby version on a per-user basis.
  • Provide support for per-project Ruby versions.
  • Allow you to override the Ruby version with an environment variable.

In contrast with rvm, rbenv does not...

  • Need to be loaded into your shell. Instead, rbenv's shim approach works by adding a directory to your $PATH.
  • Override shell commands like cd. That's dangerous and error-prone.
  • Have a configuration file. There's nothing to configure except which version of Ruby you want to use.
  • Install Ruby. You can build and install Ruby yourself, or use ruby-build to automate the process.
  • Manage gemsets. Bundler is a better way to manage application dependencies. If you have projects that are not yet using Bundler you can install the rbenv-gemset plugin.
  • Require changes to Ruby libraries for compatibility. The simplicity of rbenv means as long as it's in your $PATH, nothing else needs to know about it.
  • Prompt you with warnings when you switch to a project. Instead of executing arbitrary code, rbenv reads just the version name from each project. There's nothing to "trust."

Installation

You can install rbenvAUR from the AUR.

Plugins

rbenv can be extended via a plugin system, and the rbenv wiki includes a list of useful plugins. The ruby-build plugin is especially useful, as it allows you to install Ruby versions with the rbenv install command. You can install ruby-buildAUR from the AUR.

External links