ruby 1.9 ri on Windows knows nothing about any classes - ruby

I'm using Windows XP SP2, and installed Ruby through Ruby 1.9 one click installer. Then when I try to using ri, I get the following response, can anyone help me with my problem?
C:\Documents and Settings\eyang>ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
C:\Documents and Settings\eyang>ri --version
ri 2.2.2
C:\Documents and Settings\eyang>ri String
Updating class cache with 0 classes...
Nothing known about String
C:\Documents and Settings\eyang>ri
Updating class cache with 0 classes...
No ri data found
If you've installed Ruby yourself, you need to generate documentation using:
make install-doc
from the same place you ran `make` to build ruby.
If you installed Ruby from a packaging system, then you may need to
install an additional package, or ask the packager to enable ri generation.
C:\Documents and Settings\eyang>
By the way, when I try to use gem, I got the following error messages too, anyone can explain it?
C:\Documents and Settings\eyang>gem --version
1.3.5
C:\Documents and Settings\eyang>gem query --remote
*** REMOTE GEMS ***
ERROR: While executing gem ... (Errno::ENOMEM)
Not enough space - <STDOUT>
C:\Documents and Settings\eyang>

Go to the same folder where your ruby is installed. Then do:
rdoc --all --ri

RubyInstaller do not bundle RI documentation, as it increased the size of the distribution and the time to install the package.
Instead, we bundled CHM (Windows Help) files for both Core and StdLib API.
This was discussed in the RubyInstaller group and the decision was made on that base.
As for your other point, two things: you need to provide a gem name or part of it, since there are 12K gems in RubyForge.
Also, depending on your console configuration (Latin or something) the Not Enough space error will be related to the terminal itself, not RubyGems.

windows rubyinstaller doesn't come with the ri for core by default, so install the rdoc-data gem, then it will have it.

If you are using rvm try $ rvm docs generate-ri

What might be helpful:
When I ran ri.cmd -l command, it worked, though there were no known Classes/Modules
When I ran ri.cmd --list-doc-dirs, I've got:
C:/Ruby25-x64/share/ri/2.5.0/system
C:/Ruby25-x64/share/ri/2.5.0/site
C:/Users/username/.rdoc</ul>
Nonetheless, there was no physical .rdoc folder (C:/Users/username/.rdoc)
Running rdoc --all --ri as recommended #GregMoreno did the trick

Related

Installing Ruby version 2.2.4 on Windows 7

I had an old version of Ruby (1.9.3) that I am using with Selenium Webdriver.But I was getting errors while running my script.So I downloaded Ruby installer 2.2.4 version and ran it. Can someone tell me what is the command line steps to fully install it ? I tried "gem update --system" and I get the error "error fetching data". I tried "gem install ruby" and it says "successfully installed rubyzip 1.1.7"
Installing Ruby on Windows is best done by downloading the installer from the Ruby Installer site and executing the binary. There are a few things to look out for:
Make sure the correct Ruby is in your PATH. E.g.:
echo %PATH%
should include a string like C:\Ruby200\bin. The installation path may be different for your version of Ruby. If you are installing a new version, you might need to edit the path using the Windows dialog so that new sessions include it.
Also, read the instructions for installing the Ruby DevKit. You'll need it for installation of gems with native extensions.
Once Ruby is installed correctly you should be able to run ruby -v in a command window to see that the expected version is there.
\

cannot load such file -- 2.2/gherkin_lexer_en, how to fix?

I need a little help. How do I resolve this problem?
When I call cucumber I get the following error:
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansic
on/) to get coloured output on Windows
WARNING: cannot load such file -- 2.2/gherkin_lexer_en
Couldn't load 2.2/gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-1.3.19/bin/../lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/builder-3.2.2/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/diff-lcs-1.2.5/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/multi_json-1.11.0/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/gherkin-2.12.2-x86-mingw32/lib
[...]
System:
Windows 8.1 x64
Ruby 2.2.1 installer
I got answer:
https://github.com/cucumber/cucumber/issues/830#issuecomment-90837546
I'm afraid Cucumber on Windows/Ruby requires ruby 2.0.0 (x86). The
reason is that the gherkin gem doesn't yet ship with compiled binaries
for more recent versions or Ruby, and not for x64.
We're working on a Gherkin3 which will address this issue. See this
post for background. I cannot give you an ETA, but it's at least a few
months away.
I download Ruby 2.0 x86 from http://rubyinstaller.org/downloads/
Install exe
Command in cmd: gem install calabash-android
ERROR: Error installing calabash-android:
The 'json' native gem requires installed build tools.
Download from http://rubyinstaller.org/downloads/ DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
Extract DevKit to path C:\Ruby200\DevKit
Run cd C:\Ruby200\DevKit
Run ruby dk.rb init
Run ruby dk.rb review
Run ruby dk.rb install
And again use command gem install calabash-android
I have simply solved by removing Gherkin and reinstalling it by bundle install
gem uninstall gherkin
>> select all
bundle install
This problem looks like this issue. Maybe you can resolve by following comments in it. (y)
sanjaykumar5115 commented,
my probelm have been solved after uninstalling gherkin and installing gherkin-2.12.1-x86-mingw32

Could not find gem 'rubytree (~> 0.5.2) ruby' while installing ChiliProject on Debian

I am trying to install chiliproject on a server, following the -well done- documentation I am hitting this error
Could not find gem 'rubytree (~> 0.5.2) ruby' in any of the gem sources listed in your Gemfile.
I did a gem install rubytree
I get this message
========================================================================
Thank you for installing rubytree.
WARNING: SIGNIFICANT API CHANGE in 0.8.0 !
------------------------------------------
Please note that as of 0.8.0 the CamelCase method names are DEPRECATED.
The new method names follow the ruby_convention (separated by '_').
The old CamelCase methods still work (a warning will be displayed),
but may go away in the future.
Details of the API changes are documented in the API-CHANGES file.
========================================================================
Successfully installed rubytree-0.8.1
1 gem installed
Installing ri documentation for rubytree-0.8.1...
file 'COPYING,API-CHANGES' not found
Installing RDoc documentation for rubytree-0.8.1...
file 'COPYING,API-CHANGES' not found
That is saying the installation was succesful. So why do I get the error ?
If the error is from the API change how can I request version 0.5.2 of the rubytree gem ?
When I do a gem list --local | grep 'rubytree'
I have this output rubytree (0.8.1)
So why is the system saying could not find gem 'rubytree' ?
thank you for any help,
Depending on what version of rails you are using (and it sounds like you are using a relatively newer one, if it's prompting you for your Gemfile), then you need to use Bundler to manage your gems.
Try editing your Gemfile, adding a new line that reads:
gem "rubytree", "< 0.6"
Then open up a console, and type this command
bundle install
This should fix your problems, but if you still get errors when running a command, then try typing bundle exec prior to the command (i.e. rails server becomes bundle exec rails server).
Currently, we require rubytree exactly in version 0.5.2 or 0.5.3, as specified in our Gemfile, the 0.8.1. version you installed by hand will not suffice that requirement, which is exactly what the error message states.
What seems a bit odd is the literal ruby in the error message. Could you please make sure that you have the exact unchanged Gemfile from the source on your system? Also, could you please remove any user-installed plugins and try again? Also, which ruby (type and version) on which operating system are you using?

Can't find rake on Ruby Rails Install

Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Windows\system32>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
C:\Windows\system32>rake
C:/Program Files (x86)/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can
't find executable rake for rake-0.8.7 (Gem::Exception)
from C:/Program Files (x86)/Ruby192/bin/rake:19:in `<main>'
C:\Windows\system32>
Why can't my system find the rake command? Where should I start debugging the problem?
Update 1
I'm using ruby 1.9.2 and installed it using the ruby installer for windows (http://rubyinstaller.org/)
This issue is a problem of Ruby 1.9.2 bundled version of Rake. You will need to remove the included rake.gemspec from the gem specification folder.
See this thread at RubyInstaller group, and specifically this link from Ruby-Forums for the solution.
BTW: a recommendation: avoid installing Ruby into path with spaces (Program Files). I forsee lot of problems with your installation in the future.
You cannot install Ruby (or RubyGems) in a path with whitespace.
What is your PATH like? Run the following command.
echo %PATH%
Ruby on Windows is very tricky. It's not exactly designed for something like this. There are three major ways people get Ruby installed. First, they download straight binaries and try to hack together something workable. Second, they use the old one-click installer. Third, they use the new Ruby installer. If you have anything else, get rid of it and go with the third option.

How do I install the Ruby ri documentation?

I've recently installed Ruby 1.9.1 on Windows 7, and apparently it doesn't come with the standard ri documentation. So when I do 'ri Array', I get:
C:\>ri Array
Nothing known about Array
Is there a way I can install this documentation so that the above works?
In case people on other platforms need to install their ri docs (like I did). This article gives the why and the how:
http://jstorimer.com/ri.html
The command is:
gem rdoc --all --ri --no-rdoc
If you are using rvm you should rvm docs generate (or just rvm docs generate-ri)
See this info (2011August) about rvm and ri
None of the proposed solutions worked for me. In the end the solution I found was super simple, so I'll leave it here. (I'm running ruby 2.2.4 on win7 x64 in case that's relevant)
(captain obvious alert: ruby must be installed and in your PATH)
-open cmd
-$ gem install rdoc-data
-$ rdoc-data --install
And you're set! test that it worked by running:
-$ ri Array It should give you all the lovely documentation for the class!
Hope this helps!
ps. I just noticed that this is the solution that Luis Lavena proposed in a comment, but his comment wasn't clear to me so I had continued searching. Basically this is the same solution but explained more clearly so that that doesn't happen to anyone else :)
Cheers!
Things are still largely the same with Ruby Installer 2.4.1.2 (year 2017). If I run ri Array, it shows Array < Object and nothing else. If I run ri "Array#each", I get the familiar "Nothing known..." message. In short, the ri-format documentation on Ruby core and standard libraries are missing.
Here's how I got my copy of core/stdlib ri-documentation. Of course, Ruby must be installed prior to this.
Get ruby's source code that most closely matches my version from their Github releases page.
Extract the .zip or .tar.gz archive to some folder
Open cmd.exe/Powershell, cd to that folder and run rdoc --all --ri
This command parses .c files, .rb files, and a few other file types in the current directory recursively and generates ri-documentation to ~/.rdoc directory.
Took about 5 minutes on my laptop with i7-3520M processor to complete, with no errors.
Delete the archive and the directory containing the source code because we don't need them anymore.
Now if you try running ri Array or ri "Array#each" you'll get the documentation in all its glory.
tl;dr
Run rdoc --all --ri on directory containing source code for same ruby version as your installed version.
Appendix Z: Comments on other answers
The rvm docs generate-ri could work, but you have to use Cygwin or Ubuntu on Windows (if on Windows 10) to use rvm.
gem rdoc --all --ri --no-rdoc installs ri-documentation for all your gems. It doesn't install the core/stdlib documentations.
gem install rdoc-data followed by rdoc-data --install only works for Ruby versions up to 2.3.0.
Seems you have installer Ruby 1.9.1 distributed by the RubyInstaller project.
You can use the Windows Help Files (CHM) that came with the installer instead of the ri documentation.
The problem of the RI documentation is that some versions of RDoc have problems generating it and also generated more than 10 thousands files which slowed down the installers considerably.
RVM does not automatically generate and install each Ruby's ri / rdoc documentation. You can generate using the following command:
rvm docs generate
All the Ruby Docs are at http://www.ruby-doc.org
So the array documentation is at:
http://ruby-doc.org/core/classes/Array.html
Never tried it on windows but because its saying Nothing Known about X its not that its not installed just not got anything there.
Try installing a gem as you can then ri GEM_CLASS as that should provide defentions, should let us see if its missing documentation or if ri's not looking in the right place
You might run into this issue under Docker. The official docker images come with no documentation, and apparently disable installing gem documentation.
If image's and system ruby versions match (specifically, RbConfig::CONFIG["ruby_version"], which is e.g. 2.6.0 for ruby-2.6.1), you can:
# apk add ruby-doc
# cp -r /usr/share/ri /usr/local/share/ri

Resources