Ruby ri file - Nothing known about File error - ruby

I tried installing a gem first gem install rdoc-data
After it successfully installed, I tried rdoc-data --install However, I get the error:
Your ruby version 2.1.1 is not supported, only 1.8.7, 1.9.2, 1.9.3, 2.0.0
Does this mean I have to downgrade to Ruby 2.0.0?
I tried running ri File to read the documentation however all I get is the message: Nothing known about File.
Did some research into older Stack Overflow posts and someone suggested running rvm docs generate however all I get is "Currently 'rvm docs ...' does not work with non-rvm rubies.

Install ri documentation first:
rvm docs generate-ri

I used
gem install rdoc-data
gem rdoc --all --ri --no-rdoc
Don't forget to open a new terminal window, then ri "test" ri "if" etc should thereafter.
These commands came from here and here

Related

How to install Ruby ri documentation for Ruby v2.1.7

Can somebody point me to how I can install the ri documentation for v2.1.7?
I tried "How do I install the Ruby ri documentation?" with no luck.
I would prefer installing ri so that I can lookup specific methods in a class directly without opening the help file.
Also, I had no luck with the following:
C:\Users\ram\ruby>gem install rdoc-data
Fetching: rdoc-data-4.0.1.gem (100%)
rdoc-data is only required for C ruby 1.8.7 or 1.9.1.
rdoc-data is required for JRuby.
To install ri data for RDoc 4.0+ run:
rdoc-data --install
Successfully installed rdoc-data-4.0.1
Parsing documentation for rdoc-data-4.0.1
Installing ri documentation for rdoc-data-4.0.1
Done installing documentation for rdoc-data after 1 seconds
1 gem installed
C:\Users\ram\ruby>ri Array
Nothing known about Array
C:\Users\ram\ruby>rdoc-data --install
Your ruby version 2.1.7 is not supported, only 1.8.7, 1.9.2, 1.9.3, 2.0.0
It seems that for v2.1.7 something else is required.
Note this is for Windows. I want to do it natively without using VM/Cygwin, etc.
As your error message indicates, rdoc-data doesn't support ruby 2.1.7.
If you're using RVM, try:
rvm docs generate
Be patient, it takes several minutes to install the documentation.
If you want the ri documentation installed by default for all gem installations, check your gem config file ~/.gemrc to see if you have defaults set up that excludes documentation. Remove any and all of the following:
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
install: --no-document
update: --no-document
gem: --no-document
I believe gems install documentation by default. If not, add this to the gem config file
gem: --ri
Since you're on Windows, you can install Cygwin on your Windows machine and then install RVM using Cygwin. Or, you can download the rdocs source files http://ruby-doc.org/downloads/ and extract them to your Ruby docs folder /Users/userprofile/.rvm/gems/ruby-2.1.7/doc/.
I did a cursory glance, and didn't see ruby 2.1.7; it goes straight from 2.1.6 to 2.2.0. You can dump 2.1.6 in the ruby-2.1.7/doc/ folder or update your Ruby version to one that is supported.

Long installing ri documentation for rails-4.0.2

I'm have two machines with Ubuntu and Debian.
I installed RVM on every machines, and installed latest stable ruby. But when i'm trying make
gem install rails gem starting install all gems and stopping on "Installing ri documentation for rails-4.0.2".
What i'm doing wrong? Thank you
It is good that it installs all dependency gems first, but strange that halts. How much time the installation of ri get?
Anyway, to disable ri or rdoc installation, add the following file inside of your home folder in yaml format:
~/.gemrc
---
gem: --no-ri --no-rdoc
verbose: true
backtrace: true
NOTE: The verbose and backtrace are useful, but optional parameters.

watir gem install error due to mini_magick file w/ special characters

I have been trying to install the watir gem for ruby 2. I followed the watir books install instructions exactly but once the watir install get to the mini_magick gem it gives this error
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - C:/Ruby200/lib/ruby/gems/2.0.0/gems/mini_magick-3.6.0/tes
t/files/special! "chars'.gif
Anyone know how to get around this? I noticed that nokogiri was acting kind of weird being unable to convert from ASCII to ITF-8. Maybe this has something to do with it. Thanks y'all
I ran into same problem and here was my solution to work around it. The problem seems to be in the new 3.6.0 version, so back out the new version and install the previous version.
gem uninstall mini_magick
gem install mini_magick -v 3.5.0
After installing 3.5.0 mini_magick gem, rerun the watir gem install. It should find the mini_magick gem already installed and skip over it and install the remaining gems successfully. Good luck.

gem install rails does not work

I am working on ubuntu and rvm. In any case I tried to use sudo gem (any command) it does not recognize gem as command. In addition if I use gem seperately as:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: Possible alternatives: rails
I got that error. I cannot see the reason.
rvm version 1.10.3
ruby version 1.8.7
gem version 1.6.7
What is the possible reason behind this?
Re-install all rvm and ruby and the gems, solved my problem.

Can't install gemcutter as a Ruby Gem source

I'm trying to install the thinking sphinx gem, which is on gemcutter.org
When I run the command
gem sources -a http://gemcutter.org
I get the error:
Error fetching http://gemcutter.org:
bad response Not Found 404 (http://gemcutter.org/specs.4.8)
If I change the above URL to http://gemcutter.org.specs.4.8.gz it finds a file. How do I tell rubygems to download with the .gz extension?
It looks like a temporary Gemcutter failure. It works fine to me.
Make sure you are running the latest RubyGems version and install the latest gemcutter gem.
$ gem install gemcutter --source http://gemcutter.org
With the gemcutter GEM you type gem tumble to add Gemcutter as source.
$ gem tumble
EDIT. I just noticed you are using a really outdated RubyGems version.
Update RubyGems first.
$ gem update --system
If it tells you there's nothing to update, you have a buggy version (RubyGems 1.2 selfupdate was buggy). Upgrade with the following command.
$ gem install rubygems-update
$ update_rubygems
Then add the source.
What version of Rubygems are you running (gem --version)? If less than 1.3.5, you may want to update Rubygems and try again. (gem update --system)
This is working for me with the following sources defined:
http://gems.rubyforge.org/
http://gems.github.com
as I said this is working for me:
gem install thinking-sphinx \
> --source http://gemcutter.org
If you're upgrading, you should read this:
http://freelancing-god.github.com/ts/en/upgrading.html
Successfully installed thinking-sphinx-1.3.2
Successfully installed activesupport-2.3.4
2 gems installed
Installing ri documentation for thinking-sphinx-1.3.2...
Installing ri documentation for activesupport-2.3.4...

Resources