I'm new to ruby. I tried to install GEM on my PC by following the steps given in the site http://rubygems.org/pages/download .
I downloaded the package from the mention site and changed the directory to the directory in which the setup resides and tried to run setup using the command,
setup.rb in command prompt.
but I get a window pop up that says "Windows can't open this file" and prompts me to select a program to open this file.
What should I do now? Let me know, if I do something wrong..
Installing Ruby
Go to http://rubyinstaller.org/downloads/
Make sure that you check "Add ruby ... to your PATH".
Now you can use "ruby" in your "cmd".
If you installed ruby 1.9.3 I expect that the ruby is downloaded in
C:\Ruby193
.Installing Gem
install Development Kit in rubyinstaller. Make new folder such as
C:\RubyDevKit
and unzip.Go to the devkit directory and type
ruby dk.rb init
to generateconfig.yml
.If you installed devkit for 1.9.3, I expect that the
config.yml
will be written asC:\Ruby193
.If not, please correct path to your ruby folders.
After reviewing the
config.yml
, you can finally typeruby dk.rb install
.Now you can use "gem" in your "cmd". It's done!
To setup you Ruby development environment on Windows:
Install Ruby via RubyInstaller: http://rubyinstaller.org/downloads/
Check your ruby version: Start - Run - type in
cmd
to open a windows consoleruby -v
ruby 2.0.0p353 (2013-11-22) [i386-mingw32]
For Ruby 2.4 or later, run the extra installation at the end to install the DevelopmentKit. If you forgot to do that, run
ridk install
in your windows console to install it.For earlier versions:
gem install {gem name}
. For example, to install rails, just rungem install rails
.Hope this helps.
Use chocolatey in PowerShell
Check that ruby interpreter is already installed and try "ruby setup.rb" in command prompt.
I recommend you just use rubyinstaller
It is recommended by the official Ruby page - see https://www.ruby-lang.org/en/downloads/
I use scoop as command-liner installer for Windows... scoop rocks!
The quick answer (use PowerShell):
Longer answer:
Just searching for ruby:
Check the installation info :
Output from installation: