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.
Related
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.
\
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
I'm setting up a ruby Apache Buildr on a fresh Windows 7 machine.
I've installed Ruby, the DevKit and installed buildr via
gem install buildr
wich all ran perfect.
Until I tried to execute buildr, then I get an error.
buildr compile
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3, minitar-0.5.3, minitest-1.6.0, net-sftp-2.0.4, net-ssh-2.0.23, rake-0.8.7, rdoc-2.5.8, rjb-1.3.2-x86-mswin32-60, rspec-2.1.0, rspec-core-2.1.0,rspec-expectations-2.1.0, rspec-mocks-2.1.0, rubyforge-2.0.3, rubygems-update-1.8.4, rubyzip-0.9.4, xml-simple-1.0.12] (Gem::LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from C:/Ruby192/bin/buildr:18:in `<main>'
When I list all the gems with
gem list buildr
Everything seems to match up, and this error makes no sense at all.
Any ideas?
Help would be great, I'm getting desperate now. :)
Had the same problem. I have Windows 7 x64 so installed again with gem install buildr --platform mswin64 and it worked.
I had a similar problem in the past.
My problem was the kind of installation.
I installed ruby as admin (target was c:\program files). Everything worked fine - until I installed a gem as normal user (not admin).
What happened on windows side? I have no authorization for c:\program files, the gem was installed in another directory (No, there was no error, Windows just decided to use another directory. This bug/feature is called 'Virtual Store').
In the end Ruby had problems to find the files.
My solution:
Install ruby as normal user outside c:\program files.
Maybe it is enough, when you install your gems as admin (but attention: if you have once files in your Virtual store, they are read always first.).
Installed Ruby 1.8.7 instead and it works now.
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
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