How to Recompile a Ruby with Rvm

How do I recompile a ruby with RVM?

Ah hah. rvm uninstall [RUBY] followed by rvm install [RUBY] does the trick.

or nicer:

rvm reinstall [RUBY]

How to compile ruby with RVM on a low memory system?

Creating a 512MB swap-file solved the problem. Here are the steps:

sudo mkdir -p /var/cache/swap/
sudo dd if=/dev/zero of=/var/cache/swap/swap0 bs=1M count=512
sudo chmod 0600 /var/cache/swap/swap0
sudo mkswap /var/cache/swap/swap0
sudo swapon /var/cache/swap/swap0

The swap file is not used after a restart. It can be integrated in /etc/fstab to use it after restart:

 /var/cache/swap/swap0    none    swap    sw      0 0

The above steps to create a swap-file I found here (in German): http://wiki.ubuntuusers.de/Swap#Swap-als-Datei - licence for the above content: http://creativecommons.org/licenses/by-nc-sa/2.0/de/deed.en (Attribution-NonCommercial-ShareAlike 2.0 Germany (CC BY-NC-SA 2.0 DE))

Ruby and You must recompile Ruby with OpenSSL support or change the sources in your Gemfile

The new way to do it, according to a comment by @Purplejacket above, is the following:

rvm autolibs homebrew
rvm install 2.1.1
rvm use 2.1.1

It's much easier.

Add existing ruby to RVM

To install ruby 1.8.7 through RVM

rvm install ruby-1.8.7

To use existing system ruby

rvm use system

Error while compiling Ruby (RVM)

It looks like you are compiling ruby against static version of libraries, this could happen in rather few rare cases.

Make sure you read rvm requirements and install all required libraries.

Check your RVM configuration files for compilation switches:

cat /etc/rvmrc ~/.rvmrc

And finally reinstall ruby to make sure clean installation is done:

rvm reinstall 1.9.3

As a note right now it's equivalent to rvm install ruby as 1.9.3 is the latest version of ruby.

How to reinstall ruby with readline support?

Your ruby should be most likely installed with readline support if you had the packages from rvm requirements installed.

You can verify that readline is installed by running:

rvm use 1.9.3
find $MY_RUBY_HOME -name readline.so | xargs ldd

From what I see in the responses a proper flow has to be repeated:

rm -rf $rvm_path/usr/
rvm get head
rvm remove 1.9.3
rvm install 1.9.3 --debug

If you still can not get it working - please make double sure you repeat the above steps, do not add additional flags or switches, make sure to clean up /etc/rvmrc and ~/.rvmrc from extra compilation flags. if it all fails provide output of the rvm install 1.9.3 --debug command.

troubles with RVM and OpenSSL

Try this:

rvm get head
rvm pkg remove
rvm requirements run # if brew gives you warnings about formulas to install, run "brew install" for each before moving on.

rvm reinstall [the version you need (i.e: 2.0.0)]


Related Topics



Leave a reply



Submit