Installing Ruby Gem in Windows

2020-01-26 03:16发布

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..

标签: ruby gem install
7条回答
萌系小妹纸
2楼-- · 2020-01-26 04:04

Another way is to let chocolatey manage your ruby package (and any other package), that way you won't have to put ruby in your path manually:

Install chocolatey first by opening your favourite command prompt and executing:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

then all you need to do is type

cinst ruby

In your command prompt and the package installs.

Using a package manager provides overall more control, I'd recommend this for every package that can be installed via chocolatey.

查看更多
登录 后发表回答