Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 851 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you remove the documentation installed by gem install?

#1
I know it's possible to install a gem without the documentation, but unfortunately, I didn't for the first three months I used ruby. In that time, I managed to install a significant amount of gems, but not once since I started using ruby have I used the documentation on my computer. I always look to docs on the internet.

What is the best way to safely remove the documentation from my computer? Also, is there a way to configure ruby to not install documentation by default?
Reply

#2
This command worked for me in removing documentation installed by install.

rm -r "$(gem env gemdir)"/doc/*

**Here's another way to go about it;**

To locate the folder where gems are installed on your system, simply run the following on terminal or shell

gem env home

This will display an output like

/home/username/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0

You can then locate the docs folder and delete all the documentations that you find there for each gem in a ruby version


**I also want to add this too to the answers provided,**

if want to prevent gems from generating documentation during installation, then turn off local documentation generation by creating a file called ~/.gemrc which contains a configuration setting to turn off this feature:

Simply run this code in your terminal or shell

printf "install: --no-rdoc --no-ri\nupdate: --no-rdoc --no-ri\n" >> ~/.gemrc

OR

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

This will prevent gems from generating documentation during installation, saving you the stress of deleting/removing gem documentations on your system later.

That's all

**I hope this helps.**
Reply

#3
I understand there is a .gemrc file that may be used.

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

puts the two lines in it.
I believe you put the .gemrc file in your $Home directory.
Reply

#4
Copy & paste any of these into a Bourne-compatible shell:

### Remove existing docs for locally-installed gems, current-user only
<!--lang: sh -->

(exec 1>&2; DIR="$(gem env gemdir)"; \
DOCDIR="$DIR"/doc; \
if [ -d "$DOCDIR" ]; then \
echo "Contents of '$DOCDIR': "; ls "$DOCDIR"/; echo ''; \
read -p "Do you really want to remove contents of RubyGems doc dir '$DOCDIR' ? [Yn] " ANS; \
if [ "$ANS" = y ] || [ "$ANS" = Y ]; then \
rm -rf "$DOCDIR"/*; \
fi; \
fi)

### Remove docs for all globally installed system gems

(exec 1>&2; for DIR in $(gem env path | tr ':' '\n'); do \
DOCDIR="$DIR"/doc; \
if [ -d "$DOCDIR" ]; then \
echo "Contents of '$DOCDIR': "; ls "$DOCDIR"/; echo ''; \
echo '!! Possibly removes system-provided gem docs, review carefully before continuing ("n" if unsure or Ctrl-C to abort completely) !!'; \
read -p "Do you really want to remove RubyGems doc dir '$DOCDIR' ? [Yn] " ANS; \
if [ "$ANS" = y ] || [ "$ANS" = Y ]; then \
sudo rm -rf "$DOCDIR"/*; \
fi; \
fi; \
done)

## Prevent current user from generating gems docs from now onwards

with modern RubyGems:

(X='gem: --no-document'; \
touch ~/.gemrc && \
grep -q "^$X$" ~/.gemrc || echo "$X" >> ~/.gemrc)

with old RubyGems: `X='gem: --no-ri --no-rdoc' ...`
Reply

#5
run this command:

rm -r "$(gem env gemdir)"/doc/*

on windows if you use cygwin
Reply

#6
Gem documentation is installed in [RUBY]/lib/ruby/gems/doc, where [RUBY] is the directory into which you installed Ruby (C:/ruby on my machine).

I don't see why you shouldn't just delete the folders representing the gems for which don't don't need documentation: you can always regenerate it.
Reply

#7
I can't answer the first part of your problem (I have the same issue myself) but I have managed to not install documentation by default.

You can specify some default command line options in the [gem config file][1], you can specify not to generate documentation (something like --no-rdoc and --no-ri).


Sam

[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through