Rectangle 27 106

You can simply remove the doc directory in the RubyGems installation directory.

rm -r `gem env gemdir`/doc
/Library/Ruby/Gems/1.8/doc

Keep in mind that there might be several installation directories for RubyGems.

  • RubyGems will try to install to your user directory (something like ~/.gem/ruby/1.8/) if it can't access the normal installation directory (e.g. you installed a gem without sudo).
  • RVM also installs RubyGems for each Ruby it installs which will contain a doc directory containing rdoc and ri files (e.g. ~/.rvm/gems/ruby-1.9.2-preview1/doc).

This will merely remove existing files, but new ones will come with new installations anyway, unless you use the --no-document flag for gem install or make it a default.

--no-ri --no-rdoc has been deprecated in favor of --no-document, but this answer works the best.

ruby - How to remove installed ri and rdoc? - Stack Overflow

ruby rubygems
Rectangle 27 104

You can simply remove the doc directory in the RubyGems installation directory.

rm -r `gem env gemdir`/doc
/Library/Ruby/Gems/1.8/doc

Keep in mind that there might be several installation directories for RubyGems.

  • RubyGems will try to install to your user directory (something like ~/.gem/ruby/1.8/) if it can't access the normal installation directory (e.g. you installed a gem without sudo).
  • RVM also installs RubyGems for each Ruby it installs which will contain a doc directory containing rdoc and ri files (e.g. ~/.rvm/gems/ruby-1.9.2-preview1/doc).

This will merely remove existing files, but new ones will come with new installations anyway, unless you use the --no-document flag for gem install or make it a default.

--no-ri --no-rdoc has been deprecated in favor of --no-document, but this answer works the best.

ruby - How to remove installed ri and rdoc? - Stack Overflow

ruby rubygems
Rectangle 27 1

gem rdoc <gem name> --no-ri --overwrite

Then you can remove only ri of the gem, and leave the gem itself. I don't see we need any other way around for this.

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

Do you think I didn't understand the question? The question was "How can I remove the ri and rdoc of installed gems?" :)

You asked the OP to try something, which sounds like a guess, and hence a comment. If you are sure of what you are writing in your answer, I don't see why you'll use such words.

ruby - How to remove installed ri and rdoc? - Stack Overflow

ruby rubygems
Rectangle 27 1

gem rdoc <gem name> --no-ri --overwrite

Then you can remove only ri of the gem, and leave the gem itself. I don't see we need any other way around for this.

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

Do you think I didn't understand the question? The question was "How can I remove the ri and rdoc of installed gems?" :)

You asked the OP to try something, which sounds like a guess, and hence a comment. If you are sure of what you are writing in your answer, I don't see why you'll use such words.

ruby - How to remove installed ri and rdoc? - Stack Overflow

ruby rubygems
Rectangle 27 10

# See the relevant help.
gem help rdoc

# Generate rdoc and ri for the "foo" gem.
gem rdoc --ri foo

# Generate rdoc for all installed gems.
gem rdoc --all
gem rdoc --all --ri

ruby on rails - How can I install ri and rdoc files for gems afterward...

ruby-on-rails gem
Rectangle 27 11

The point of installing ri documentation is simply that you can use the "ri" command to access method-by-method documentation. For an example, try: "ri String#reverse". Exit by pressing "q".

To try out RDoc documentation, run "gem server" and then connect to localhost:8808 in your browser. I find it useful - you can even click on a method name to see the source code. Of course, you can just go into your gems folder and open the HTML files in the doc folder.

Anyway, you can be lazy and wait until you need the RDoc documentation, and then generate it with "gem rdoc ".

ruby - Am I missing something by not installing ri and rdoc for gems? ...

ruby rubygems
Rectangle 27 3

Personally, I'm installing my gems without rdoc and ri, too, because normally you can find all the documentation you need on the internet as well (i.e. www.rdoc.info), so there's no need for investing hard disk space and time the generation takes

ruby - Am I missing something by not installing ri and rdoc for gems? ...

ruby rubygems
Rectangle 27 2

Install it if you want locally available documentation for the gem.

ruby - Am I missing something by not installing ri and rdoc for gems? ...

ruby rubygems
Rectangle 27 2

==> which ruby
/usr/bin/ruby

==> rbenv install 1.9.3-p551
Downloading ruby-1.9.3-p551.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2
Installing ruby-1.9.3-p551...
Installed ruby-1.9.3-p551 to /Users/username/.rbenv/versions/1.9.3-p551


==> which ruby
/Users/username/.rbenv/shims/ruby

==> which gem
/Users/username/.rbenv/shims/gem

==> gem install compass
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> rbenv rehash


==> ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin15.4.0]


==> gem install compass
Fetching: sass-3.4.22.gem (100%)
Fetching: multi_json-1.11.3.gem (100%)
Fetching: compass-core-1.0.3.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.5.gem (100%)
Fetching: rb-fsevent-0.9.7.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Fetching: rb-inotify-0.9.7.gem (100%)
Fetching: compass-1.0.3.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed sass-3.4.22
Successfully installed multi_json-1.11.3
Successfully installed compass-core-1.0.3
Successfully installed compass-import-once-1.0.5
Successfully installed chunky_png-1.3.5
Successfully installed rb-fsevent-0.9.7
Successfully installed ffi-1.9.10
Successfully installed rb-inotify-0.9.7
Successfully installed compass-1.0.3
9 gems installed
Installing ri documentation for sass-3.4.22...
Installing ri documentation for multi_json-1.11.3...
Installing ri documentation for compass-core-1.0.3...
Installing ri documentation for compass-import-once-1.0.5...
Installing ri documentation for chunky_png-1.3.5...
Installing ri documentation for rb-fsevent-0.9.7...
Installing ri documentation for ffi-1.9.10...
Installing ri documentation for rb-inotify-0.9.7...
Installing ri documentation for compass-1.0.3...
Installing RDoc documentation for sass-3.4.22...
Installing RDoc documentation for multi_json-1.11.3...
Installing RDoc documentation for compass-core-1.0.3...
Installing RDoc documentation for compass-import-once-1.0.5...
Installing RDoc documentation for chunky_png-1.3.5...
Installing RDoc documentation for rb-fsevent-0.9.7...
Installing RDoc documentation for ffi-1.9.10...
Installing RDoc documentation for rb-inotify-0.9.7...
Installing RDoc documentation for compass-1.0.3...

sooo close. yet "ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."

ruby - Installing gem or updating RubyGems fails with permissions erro...

ruby osx rubygems
Rectangle 27 2

==> which ruby
/usr/bin/ruby

==> rbenv install 1.9.3-p551
Downloading ruby-1.9.3-p551.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2
Installing ruby-1.9.3-p551...
Installed ruby-1.9.3-p551 to /Users/username/.rbenv/versions/1.9.3-p551


==> which ruby
/Users/username/.rbenv/shims/ruby

==> which gem
/Users/username/.rbenv/shims/gem

==> gem install compass
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> rbenv rehash


==> ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin15.4.0]


==> gem install compass
Fetching: sass-3.4.22.gem (100%)
Fetching: multi_json-1.11.3.gem (100%)
Fetching: compass-core-1.0.3.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.5.gem (100%)
Fetching: rb-fsevent-0.9.7.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Fetching: rb-inotify-0.9.7.gem (100%)
Fetching: compass-1.0.3.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed sass-3.4.22
Successfully installed multi_json-1.11.3
Successfully installed compass-core-1.0.3
Successfully installed compass-import-once-1.0.5
Successfully installed chunky_png-1.3.5
Successfully installed rb-fsevent-0.9.7
Successfully installed ffi-1.9.10
Successfully installed rb-inotify-0.9.7
Successfully installed compass-1.0.3
9 gems installed
Installing ri documentation for sass-3.4.22...
Installing ri documentation for multi_json-1.11.3...
Installing ri documentation for compass-core-1.0.3...
Installing ri documentation for compass-import-once-1.0.5...
Installing ri documentation for chunky_png-1.3.5...
Installing ri documentation for rb-fsevent-0.9.7...
Installing ri documentation for ffi-1.9.10...
Installing ri documentation for rb-inotify-0.9.7...
Installing ri documentation for compass-1.0.3...
Installing RDoc documentation for sass-3.4.22...
Installing RDoc documentation for multi_json-1.11.3...
Installing RDoc documentation for compass-core-1.0.3...
Installing RDoc documentation for compass-import-once-1.0.5...
Installing RDoc documentation for chunky_png-1.3.5...
Installing RDoc documentation for rb-fsevent-0.9.7...
Installing RDoc documentation for ffi-1.9.10...
Installing RDoc documentation for rb-inotify-0.9.7...
Installing RDoc documentation for compass-1.0.3...

sooo close. yet "ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."

ruby - Installing gem or updating RubyGems fails with permissions erro...

ruby osx rubygems
Rectangle 27 2

==> which ruby
/usr/bin/ruby

==> rbenv install 1.9.3-p551
Downloading ruby-1.9.3-p551.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2
Installing ruby-1.9.3-p551...
Installed ruby-1.9.3-p551 to /Users/username/.rbenv/versions/1.9.3-p551


==> which ruby
/Users/username/.rbenv/shims/ruby

==> which gem
/Users/username/.rbenv/shims/gem

==> gem install compass
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


==> rbenv global 1.9.3-p551


==> rbenv rehash


==> ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin15.4.0]


==> gem install compass
Fetching: sass-3.4.22.gem (100%)
Fetching: multi_json-1.11.3.gem (100%)
Fetching: compass-core-1.0.3.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.5.gem (100%)
Fetching: rb-fsevent-0.9.7.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Fetching: rb-inotify-0.9.7.gem (100%)
Fetching: compass-1.0.3.gem (100%)
    Compass is charityware. If you love it, please donate on our behalf at http://umdf.org/compass Thanks!
Successfully installed sass-3.4.22
Successfully installed multi_json-1.11.3
Successfully installed compass-core-1.0.3
Successfully installed compass-import-once-1.0.5
Successfully installed chunky_png-1.3.5
Successfully installed rb-fsevent-0.9.7
Successfully installed ffi-1.9.10
Successfully installed rb-inotify-0.9.7
Successfully installed compass-1.0.3
9 gems installed
Installing ri documentation for sass-3.4.22...
Installing ri documentation for multi_json-1.11.3...
Installing ri documentation for compass-core-1.0.3...
Installing ri documentation for compass-import-once-1.0.5...
Installing ri documentation for chunky_png-1.3.5...
Installing ri documentation for rb-fsevent-0.9.7...
Installing ri documentation for ffi-1.9.10...
Installing ri documentation for rb-inotify-0.9.7...
Installing ri documentation for compass-1.0.3...
Installing RDoc documentation for sass-3.4.22...
Installing RDoc documentation for multi_json-1.11.3...
Installing RDoc documentation for compass-core-1.0.3...
Installing RDoc documentation for compass-import-once-1.0.5...
Installing RDoc documentation for chunky_png-1.3.5...
Installing RDoc documentation for rb-fsevent-0.9.7...
Installing RDoc documentation for ffi-1.9.10...
Installing RDoc documentation for rb-inotify-0.9.7...
Installing RDoc documentation for compass-1.0.3...

sooo close. yet "ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."

ruby - Installing gem or updating RubyGems fails with permissions erro...

ruby osx rubygems
Rectangle 27 1

According to chapter 10 of the RubyGems Command reference, you can use gem rdoc to install rdoc.

Usage: gem rdoc [args] [options]

  Options:
        --all                        Generate RDoc documentation for all installed gems
    -v, --version VERSION            Specify version of gem to rdoc

  Common Options:
        --source URL                 Use URL as the remote source for gems
    -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations
    -h, --help                       Get help on this command
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging

  Arguments:
    GEMNAME          The gem to generate RDoc for (unless --all)

  Summary:
    Generates RDoc for pre-installed gems

  Defaults:
    --version '> 0.0.0'

ruby on rails - How can I install ri and rdoc files for gems afterward...

ruby-on-rails gem
Rectangle 27 1

It appears that this is dependent on where Ruby--and by extension gem--is installed in general, not just with RVM. I installed Ruby from source. The default install location when your are building from source is /usr/local/bin, so I installed Ruby there. Naturally this installs gem and all the other tools that come with Ruby in the same directory as well. I had my gemrc under /etc, but it didn't start working until I moved it to /usr/local/etc instead.

I later re-installed Ruby under /usr/bin instead /usr/local/bin and got the same result. It is now looking for gemrc under /usr/etc instead of /usr/local/etc. The gem tool must be looking for a path relative to where it's installed like ../etc when searching for the system-wide gemrc file.

ruby - Disable rdoc and ri generation by default for rubygems 1.8.x - ...

ruby rubygems
Rectangle 27 1

It appears that this is dependent on where Ruby--and by extension gem--is installed in general, not just with RVM. I installed Ruby from source. The default install location when your are building from source is /usr/local/bin, so I installed Ruby there. Naturally this installs gem and all the other tools that come with Ruby in the same directory as well. I had my gemrc under /etc, but it didn't start working until I moved it to /usr/local/etc instead.

I later re-installed Ruby under /usr/bin instead /usr/local/bin and got the same result. It is now looking for gemrc under /usr/etc instead of /usr/local/etc. The gem tool must be looking for a path relative to where it's installed like ../etc when searching for the system-wide gemrc file.

ruby - Disable rdoc and ri generation by default for rubygems 1.8.x - ...

ruby rubygems
Rectangle 27 1

You could use a post-install message to explain that they can make it install quicker by running what @shime suggested: echo 'gem: --no-ri --no-rdoc' > ~/.gemrc

ruby - Disable rdoc and ri from gemspec / Gemfile - Stack Overflow

ruby rubygems gem bundler rdoc
Rectangle 27 3

$ sudo apt-get install build-essential ruby1.9.1-full libsqlite3 libsqlite3-dev rubygems1.9
$ sudo gem install sqlite3-ruby rails thin --no-rdoc --no-ri
$ ruby -e "require 'rubygems'; require 'sqlite3'" 
-e:1:in `require': no such file to load -- sqlite3 (LoadError)
        from -e:1:in `<main>'
$ export GEM_PATH=/usr/lib/ruby1.9.1/gems/1.9.1/

rubygems - Ruby 1.9.1 Load Path Craziness - Stack Overflow

ruby rubygems prawn
Rectangle 27 1

$ gem install bundler
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/latest_specs.4.8.gz)

$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/

$ gem sources  -l
*** CURRENT SOURCES ***

https://ruby.taobao.org/

$ gem install bundler 

Fetching: bundler-1.12.5.gem (100%)
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
Installing ri documentation for bundler-1.12.5
Done installing documentation for bundler after 4 seconds
1 gem installed

ruby - Error installing Bundler - Stack Overflow

ruby terminal gem bundler
Rectangle 27 1

$ gem install bundler
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/latest_specs.4.8.gz)

$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/

$ gem sources  -l
*** CURRENT SOURCES ***

https://ruby.taobao.org/

$ gem install bundler 

Fetching: bundler-1.12.5.gem (100%)
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
Installing ri documentation for bundler-1.12.5
Done installing documentation for bundler after 4 seconds
1 gem installed

ruby - Error installing Bundler - Stack Overflow

ruby terminal gem bundler
Rectangle 27 0

This article gives a great why and how of using ri:

Best point on that list is #1: ri understands Ruby. For instance:

$ ri ActiveRecord::Base#save
(from gem activerecord-3.2.8)
Implementation from ActiveRecord::Persistence

[...]

(from gem activerecord-3.2.8)
Implementation from ActiveRecord::Validations

[...]

Notice the method is found even if not directly on ActiveRecord::Base itself.

ruby - Am I missing something by not installing ri and rdoc for gems? ...

ruby rubygems