Gem Installation or Running Gem

Hi all,

I’m a WIndows user. I used the “one-click installer” and installed
ruby 1.86. I followed the book’s instructions to run RubyGem. I tried
typing commands like

-require ‘C:/ruby/bin/gem’(this is the path where the gem is stored)
-gem list

Nothing worked. Please help.

John

On Fri, Jul 13, 2012 at 1:44 PM, John L. [email protected] wrote:

John

The “require” statement is supposed to be used from inside a Ruby
program, not from the command line. If your Ruby and Rubygems
installations are properly configured, you should not need to specify
the full path yo tour gems inside your Ruby programs.

As for “gem list”, it is indeed supposed to be used from your command
prompt. It will list all gems installed on your system. If it doesn’t
work, odds are Ruby and Rubygems haven’t been properly installed.

Am 13.07.2012 21:23, schrieb Bira:

Nothing worked. Please help.
work, odds are Ruby and Rubygems haven’t been properly installed.
to install a gem (like e.g. `haml’), use from your command prompt

gem install haml

then you should be able to find it in the list of installed gems, with

gem list

in your program include the lines

require ‘rubygems’ # for Ruby version 1.8.x
require ‘haml’