
Last month marked the beginning of a new milestone for Rubist - release Ruby 2.0.0. Along with it is the updated RubyGems and new dependencies, including OpenSSL. Previously, RVM did almost nothing to resolve dependencies, installing LibYAML instead, since it was needed for RubyGemsk to function. The situation has changed with the advent of OpenSSL, as this is a big dependency. Previously for Ruby 2.0.0-rc, RVM installed OpenSSL. However, compiling OpenSSL is not an easy task using LibYAML.
New approach
To make it all work, RVM uses a new approach. Now when installing the necessary libraries, it works in tandem with the system package manager. This is not an easy task, since different systems have different names for packages, some of them are available by default, and some are not available at all!
It's just when it's easy.
It is very easy to use the existing package manager on any of the systems. Trouble starts when the system does not have a default package manager, as is the case with OSX. There are many package managers, and none of them are popular enough to become the de facto standard. Given this, RVM needs to find the installed package manager or install it in the absence of it.
Sensitive defaults
When autolibs was first added, RVM thought the user wanted all the work to be done for him. However, the reality has shown that some users think differently and prefer to install dependencies manually. Needed a compromise that satisfies all. As a result, RVM will determine available libraries and will fail if they are unavailable. Users now have the option to switch between different modes, such as “
do everything for me ” and “
I will do it myself ”.
')
Do everything for me
Users who want to install libraries automatically can use autolibs mode 4 aka. enable. This will tell RVM to find the package manager (and install it if necessary), install all the dependencies, and finally use them for compilation. If the package manager is not available (on OS X), Homebrew will be installed. However, users can also specify which manager will be installed with autolibs modes osx_port, osx_fink and smf. The smf manager is intended for the less well-known RailsInstaller SM framework.
For systems with a system package manager installed, mode 4 is identical to mode 3, which will install the missing packages.
I do it myself
For users who do not want RVM to do everything for them, there are two suitable modes. Mode 1 allows users to tell RVM to take libraries and simply give an error if they are unavailable. In cases where even automatic availability check is not needed, you can turn it off using mode 0. However, there is a nuance. Given that the code is becoming more dynamic, there is no longer a list to show what is required. This means that some libraries will be selected depending on the state of the system.
A couple tricks
To install RVM with Ruby, Ruby on Rails and the necessary libraries (aka. RailsInstaller for the poor):
\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
To use rvm in development, where sudo requires special treatment, as is the case with capistrano:
task :install_requirements do sudo “rvm --autolibs=4 requirements
More information about autolibs is available at
rvm.io/rvm/autolibs .
Feedback
We have been testing the autolibs code for a long time, but thanks to the attention of the wider public, new classes can be created and vulnerabilities fixed. If you find a vulnerability, we are happy to fix it. Send all vulnerability requests to our bug tracker
github.com/wayneeseguin/rvm/issues or to our IRC channel
webchat.freenode.net/?channels=rvmOfficial launch of RVM 2.0.
RVM 1.19 was the latest release with new features (Autolibs). In the future, all innovations will be postponed until the release of RVM 2.0. We will provide support, work on fixing bugs and update versions until a stable release of RVM 2.0 is released. But in order to have the opportunity to work on RVM 2.0, we will suspend the release of new features available in RVM 1.x.