Ruby-build: Option to omit Rdoc

Created on 19 Apr 2012  ·  12Comments  ·  Source: rbenv/ruby-build

It seems like rbenv/ruby-build is becoming the de facto method of getting Ruby >= 1.9.3. For production servers, it would be nice if we could skip the unnecessary step of building Rdoc. Can this be an option please?

enhancement rubinius

Most helpful comment

I started doing export RUBY_CONFIGURE_OPTS=--disable-install-doc in my non-dev environments to globally disable RDoc generation but that screws up Rubinius installs since ruby-build respects RUBY_CONFIGURE_OPTS for rbx. (╯°□°)╯︵ ┻━┻

All 12 comments

I agree. Let's figure out how to do this for the next version of ruby-build.

Installing with documentation should be the default, but we should skip it if you pass the --no-doc flag.

So why not support #131, and this could be another such extension?

Cross-definition option would be nice, but we can omit rdoc generation already:
CONFIGURE_OPTS="--disable-install-rdoc" ruby-build 1.9.3-p194

And with ree, you can disable rdoc with:

CONFIGURE_OPTS="--no-dev-docs" rbenv install ree-1.8.7-2012.02

From the REE-installer (took me a while to find):

[ruby-enterprise-1.8.7-2012.02]=> ./installer --help
Usage: installer [options]

    -a, --auto PREFIX                Configure Ruby with prefix PREFIX and
                                     install it without any user interaction.
        --destdir DIR                Install everthing under the given
                                     destination directory. Used when building
                                     packages for Ruby Enterprise Edition.
    -c, --configure-arg ARG          Pass an extra argument to the Ruby
                                     configure script. You can specify this
                                     option multiple times to pass multiple
                                     arguments.
        --dont-install-useful-gems   Do not install a few useful gems that are
                                     normally installed as well: passenger,
                                     rails, mysql, etc.
        --no-tcmalloc                Do not install tcmalloc support.
        --no-dev-docs                Do not install Ruby developer
                                     documentation.
    -h, --help                       Show this message.

You can turn this off using --disable-install-rdoc but it'd be great to do it by default. Can pass --enable-install-rdoc to enable.

I always do:

./configure --disable-install-doc

Which does not install rdoc and cdoc. I don't need them and this speeds up the overall install process.

I started doing export RUBY_CONFIGURE_OPTS=--disable-install-doc in my non-dev environments to globally disable RDoc generation but that screws up Rubinius installs since ruby-build respects RUBY_CONFIGURE_OPTS for rbx. (╯°□°)╯︵ ┻━┻

Before install Ruby and rails:

echo "gem: --no-document" > ~/.gemrc
sudo echo "gem: --no-document" > /etc/gemrc

Ruby Install:

./configure --disable-install-doc

Gem Install:

gem install thin --no-document 
gem install update --no-document 

@SaimonL That's a good practice to keep while installing gems. I have it set up that way in my ~/.gemrc as well. But in this thread we're discussing about preventing RDoc/ri generation for a Ruby version that's being installed, not any specific RubyGem. Since installation of Ruby itself doesn't (and shouldn't) respect ~/.gemrc, we have to pass the configuration process specific flags to prevent the default RDoc generation.

Was this option ever added or is the best course of action still do to the following?

RUBY_CONFIGURE_OPTS=--disable-install-doc ruby-build ...

No, there isn't an option yet. Yes, the environment variable is still the way to go.

We can select to omit documentation generating with RUBY_CONFIGURE_OPT. I think it's better than the built-in option of ruby-build.

Was this page helpful?
0 / 5 - 0 ratings