zzet / rbenv

Ansible role for installing rbenv.
https://galaxy.ansible.com/zzet/rbenv/
188 stars 112 forks source link

Disable install rdoc on ruby installation #86

Closed andrba closed 7 years ago

andrba commented 7 years ago

On VMs with 512Mb ram rbenv install fails with the following error:

deploy@vagrant-ubuntu-trusty-64:~$ ~/.rbenv/bin/rbenv install 2.3.3
Downloading ruby-2.3.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2
Installing ruby-2.3.3...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20161121-14-gd799bdd)

Inspect or clean up the working tree at /tmp/ruby-build.20161220100047.23023
Results logged to /tmp/ruby-build.20161220100047.23023.log

Last 10 log lines:
 99% [941/946]  vm_eval.c
 99% [942/946]  vm_exec.c
 99% [943/946]  vm_insnhelper.c
 99% [944/946]  vm_method.c
 99% [945/946]  vm_trace.c
100% [946/946]  vsnprintf.c

Generating RI format into /tmp/ruby-build.20161220100047.23023/ruby-2.3.3/.ext/rdoc...
Killed
make: *** [rdoc] Error 137

This modification is to ensure there is no documentation to set up during the installation:

deploy@vagrant-ubuntu-trusty-64:~$ CONFIGURE_OPTS='--disable-install-rdoc' ~/.rbenv/bin/rbenv install 2.3.3
Downloading ruby-2.3.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.bz2
Installing ruby-2.3.3...
Installed ruby-2.3.3 to /home/deploy/.rbenv/versions/2.3.3

Fetching: bundler-1.13.6.gem (100%)
Successfully installed bundler-1.13.6
1 gem installed
paulRbr commented 7 years ago

Hi @andrba,

I don't believe adding hard-coded compilation configuration environment variables is a good idea in a playbook.

However you are right it is for now not possible to override the env used during the ruby compilation.

The PR https://github.com/zzet/ansible-rbenv-role/pull/85 adds the possibility the add env variables for a specific ruby installation. Would you want to give it a try?

We have used this branch to successfully install the newest ruby 2.3 with extra compilation options on all our production servers at Train line Europe. Let me know what you think about this solution.

andrba commented 7 years ago

Hi @paulRbr, thanks for pointing out that PR. The approach you used in it is so much better. Closing this PR in favour of #85