<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Hieraki recent changes</title>
    <link>http://docs.rubygems.org/</link>
    <description>Hieraki recent changes</description>
    <language>en-us</language>
    <ttl>40</ttl>
    <item>
      <title>Jim Weirich: Installing a remote gem</title>
      <description>When you run (as root, if appropriate and necessary)

&lt;pre&gt;gem install --remote progressbar
# shortcut: gem i -r progressbar&lt;/pre&gt;

the _progressbar_ gem will be installed on your computer.  Notice that you don't need to specify the version, but you can if you want to.  It will default to the last version available.

&lt;pre&gt;gem ins -r progressbar-0.0.3&lt;/pre&gt;

or

&lt;pre&gt;gem ins -r progressbar --version '&gt; 0.0.1'&lt;/pre&gt;

In both cases, the output is simply:

  Attempting remote installation of 'progressbar'
  Successfully installed progressbar, version 0.0.3

RubyGems allows you to have multiple versions of a library installed and choose in your code which version you wish to use.

Useful extra options for installation are &lt;tt&gt;--gen-rdoc&lt;/tt&gt; for generating the gem's RDoc API documentation, and &lt;tt&gt;--run-tests&lt;/tt&gt; to run the gem's unit tests, if any.

Note too that when you remotely install a gem, it will download and install any specified dependencies.  Try installing *copland* and see that it prompts you to accept *log4r* as well (if it's not already installed).

</description>
      <pubDate>Sun, 20 May 2007 10:23:21 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/2#page5</guid>
      <link>http://docs.rubygems.org/read/chapter/2#page5</link>
    </item>
    <item>
      <title>Jim Weirich: Searching remotely installable gems</title>
      <description>When you run

&lt;pre&gt;  gem query --remote --name-matches doom
  # shortcut: gem q -R -n doom&lt;/pre&gt;

you will see a detailed list of _matching_ gems on the remote server.

Sample output:

&lt;pre&gt;
*** REMOTE GEMS ***

ruby-doom (0.8, 0.0.7)
    Ruby-DOOM provides a scripting API for creating DOOM
    maps. It also provides higher-level APIs to make map
    creation easier.
&lt;/pre&gt;

&lt;p&gt;When you run&lt;/p&gt;


&lt;pre&gt;  gem query --remote --name-matches doom
  # shortcut: gem q -R -n doom&lt;/pre&gt;

        &lt;p&gt;you will see a detailed list of &lt;em&gt;matching&lt;/em&gt; gems on the remote server.&lt;/p&gt;


        &lt;p&gt;Sample output:&lt;/p&gt;


&lt;pre&gt;
*** REMOTE GEMS ***

ruby-doom (0.8, 0.0.7)
    Ruby-DOOM provides a scripting API for creating DOOM
    maps. It also provides higher-level APIs to make map
    creation easier.
&lt;/pre&gt;</description>
      <pubDate>Sun, 20 May 2007 10:22:07 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/2#page4</guid>
      <link>http://docs.rubygems.org/read/chapter/2#page4</link>
    </item>
    <item>
      <title>Jim Weirich: Installing gems in a non-standard directory.</title>
      <description>p((. &lt;em&gt;How do I install gems in a non-standard location, such as my home directory?&lt;/em&gt;

You have to redefine the location of the GEM_HOME variable and add the paths to the gem repositories in the RUBYLIB variable before launching the installation into a custom directory.

GEM_HOME should point to $PREFIX/lib/ruby/gems/1.8 if it used with the 1.8 version of ruby.

RUBYLIB should point to the $PREFIX/lib/ruby and $PREFIX/lib/site_ruby/1.8

Here is a shell script that runs in the rubygems
distribution directory to install into /home/user :

  PREFIX=$HOME
  export GEM_HOME=$PREFIX/lib/ruby/gems/1.8 
  export RUBYLIB=$PREFIX/lib/ruby:$PREFIX/lib/site_ruby/1.8
  ruby setup.rb all --prefix=$PREFIX

You may add GEM_HOME and RUBYLIB into your ~/.profile file to automatically load on login.</description>
      <pubDate>Wed,  8 Nov 2006 00:52:31 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/15#page101</guid>
      <link>http://docs.rubygems.org/read/chapter/15#page101</link>
    </item>
    <item>
      <title>Jim Weirich: Installing gems in a non-standard directory.</title>
      <description>p((. &lt;em&gt;How do I install gems in a non-standard location, such as my home directory?&lt;/em&gt;

You have to redefine the location of the GEM_HOME variable and add the
paths to the gem repositories in the RUBYLIB variable before launching the
installation into a custom directory.

GEM_HOME should point to $PREFIX/lib/ruby/gems/1.8 if it used with the 1.8
version of ruby.

RUBYLIB should point to the $PREFIX/lib/ruby and $PREFIX/lib/site_ruby/1.8

Here is a shell script that runs in the rubygems
distribution directory to install into /home/user :

  PREFIX=/home/user
  export GEM_HOME=$PREFIX/lib/ruby/gems/1.8 
  export RUBYLIB=$PREFIX/lib/ruby:PREFIX/lib/site_ruby/1.8
  ruby setup.rb all --prefix=$PREFIX

You may add GEM_HOME and RUBYLIB into your ~/.profile file to
automatically load on login.</description>
      <pubDate>Wed,  8 Nov 2006 00:49:12 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/15#page101</guid>
      <link>http://docs.rubygems.org/read/chapter/15#page101</link>
    </item>
    <item>
      <title>Jim Weirich: Q: How do I install gems in my home directory?</title>
      <description>A: You have to redefine the location of the GEM_HOME variable and add the
paths to the gem repositories in the RUBYLIB variable before launching the
installation into a custom directory.

GEM_HOME should point to $PREFIX/lib/ruby/gems/1.8 if it used with the 1.8
version of ruby.

RUBYLIB should point to the $PREFIX/lib/ruby and $PREFIX/lib/site_ruby/1.8

Here is a shell script that runs in the rubygems
distribution directory to install into /home/user :

  PREFIX=/home/user
  export GEM_HOME=$PREFIX/lib/ruby/gems/1.8 
  export RUBYLIB=$PREFIX/lib/ruby:PREFIX/lib/site_ruby/1.8
  ruby setup.rb all --prefix=$PREFIX

You may add GEM_HOME and RUBYLIB into your ~/.profile file to
automatically load on login.</description>
      <pubDate>Wed,  8 Nov 2006 00:47:27 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/15#page101</guid>
      <link>http://docs.rubygems.org/read/chapter/15#page101</link>
    </item>
    <item>
      <title>Jim Weirich: Q1</title>
      <description>A1</description>
      <pubDate>Wed,  8 Nov 2006 00:46:44 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/15#page101</guid>
      <link>http://docs.rubygems.org/read/chapter/15#page101</link>
    </item>
    <item>
      <title>Chad Fowler: Using a gem in your code</title>
      <description>Here we demonstrate the use of the *progressbar* gem.  This library may use terminal features that are not available in your system.

If you wish, enter the following code into a file and run it. (Note that you must require the rubygems library before executing this code, as detailed in chapter 3 of this manual.)

&lt;pre&gt;
require 'progressbar'

bar = ProgressBar.new("Example progress", 50)
total = 0
until total &gt;= 50
  sleep(rand(2)/2.0)
  increment = (rand(6) + 3)
  bar.inc(increment)
  total += increment
end
&lt;/pre&gt;

Here is a "screenshot" of the partially complete progress bar.

  Example progr:  29% |ooooooooooo                             | ETA:  00:00:04

The first line of the program requires the progressbar library file.  RubyGems will look for the @progressbar.rb@ file in the standard library locations.  If not found, it will look through its gem repository for a gem that contains @progressbar.rb@.  If a gem is used, RubyGems attempts to use the latest installed version by default.

Note that the program was able to use the latest available installed gem by default _without_ any explicit action in the code.  The developer may develop a library without worrying about using RubyGems.

However, to _run_ the code, the environment does need to be "gem enabled". See "Setting Up the RubyGems Environment":http://docs.rubygems.org/read/chapter/3#page70 for details on how to make this happen.
</description>
      <pubDate>Fri, 22 Sep 2006 15:46:40 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/4#page16</guid>
      <link>http://docs.rubygems.org/read/chapter/4#page16</link>
    </item>
    <item>
      <title>Jim Weirich: Why does require return false when loading a file from a gem?</title>
      <description>p{font-style: italic}.  Require returns false when loading a file from a gem.  Usually require will return true when it has loaded correctly.  What's wrong?

h3. Answer

Nothing.  Well, something.  But nothing you need to worry about.

A false return from the require method does _not_ indicate an error.  It just means that the file has  already been loaded.

RubyGems has a feature that allows a file to be automatically loaded when a gem is activated (i.e. selected).  When you require a file that is in an inactive gem, the RubyGems software will activate that gem for you.  During that activation, any autoloaded files will be loaded for you.

So, by the time your require statement actually does the work of loading the file, it has already been autoloaded via the gem activation, and therefore it returns false.

As we said, it is not a problem, but it sure is confusing to folks doing requires in an irb session.  Future versions of RubyGems will correct this behavior.
</description>
      <pubDate>Thu,  6 Apr 2006 01:06:49 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page100</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page100</link>
    </item>
    <item>
      <title>Jim Weirich: Why does require return false when loading a file from a gem?</title>
      <description>p{font-style: italic}.  Require returns false when loading a file from a gem.  Usually require will return true when its loaded correctly.  What's wrong?

h3. Answer

Nothing.  Well, something.  But nothing you need to worry about.

A false return from the require method does not indicate an error.  It means that the file is already loaded.  Proabably the file was listed as an auto-required file in the gem, so when the gem was activated, the file was already loaded.  So when you explicitly require the file, the file has already been loaded, so require returns false.

I repeat, there is nothing wrong.

The only time this causes concern is when someone requires the file in an irb session and notices the return type.

However, the next version of RubyGems will correct this problem so that newcomers wont be surprised by the result.</description>
      <pubDate>Thu,  6 Apr 2006 00:58:38 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page100</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page100</link>
    </item>
    <item>
      <title>Jim Weirich: Why does require return false when loading a file from a gem?</title>
      <description>p{font-style: italic}.  Require returns false when loading a file from a gem.  Usually requrie will return true when its loaded correctly.  What's wrong?

h3. Answer

Nothing.  Well, something.  But nothing you need to worry about.

A false return from the require method does not indicate an error.  It means that the file is already loaded.  Proabably the file was listed as an auto-required file in the gem, so when the gem was activated, the file was already loaded.  So when you explicitly require the file, the file has already been loaded, so require returns false.

I repeat, there is nothing wrong.

The only time this causes concern is when someone requires the file in an irb session and notices the return type.

However, the next version of RubyGems will correct this problem so that newcomers wont be surprised by the result.</description>
      <pubDate>Thu,  6 Apr 2006 00:58:19 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page100</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page100</link>
    </item>
    <item>
      <title>Jim Weirich: Why does returns false when loading a file from a gem?</title>
      <description>p{font-style: italic}.  Require returns false when loading a file from a gem.  Usually requrie will return true when its loaded correctly.  What's wrong?

h3. Answer

Nothing.  Well, something.  But nothing you need to worry about.

A false return from the require method does not indicate an error.  It means that the file is already loaded.  Proabably the file was listed as an auto-required file in the gem, so when the gem was activated, the file was already loaded.  So when you explicitly require the file, the file has already been loaded, so require returns false.

I repeat, there is nothing wrong.

The only time this causes concern is when someone requires the file in an irb session and notices the return type.

However, the next version of RubyGems will correct this problem so that newcomers wont be surprised by the result.</description>
      <pubDate>Thu,  6 Apr 2006 00:57:52 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page100</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page100</link>
    </item>
    <item>
      <title>Jim Weirich: &lt;tt&gt;gemlock&lt;/tt&gt; script</title>
      <description>&lt;em&gt;(new in version 0.9.0)&lt;/em&gt;

The @gemlock@ script will generate a series of @require_gem@ commands that will lock down an application or library to a particular version of their dependent gems.

For example, if you wish to lock down a particular version of the Rails library, use:

&lt;pre&gt;
  $ gemlock rails-1.0.0
  require "rubygems"
  require_gem 'rails', '= 1.0.0'
  require_gem 'rake', '= 0.7.0.1'
  require_gem 'activesupport', '= 1.2.5'
  require_gem 'activerecord', '= 1.13.2'
  require_gem 'actionpack', '= 1.11.2'
  require_gem 'actionmailer', '= 1.1.5'
  require_gem 'actionwebservice', '= 1.0.0'
&lt;/pre&gt;

@gemlock@ will find all the direct and indirect gems required by rails-1.0.0 and specify the most recent, currently installed version of those gems.  The output should be place in the application (or library) will it will be run *before* any other require statement in the program.

If your application depends on more than one gem, just list all the gems in the command line and @gemlock@ will display the locking commands for all of them.

h3. Usage

&lt;pre&gt;
  Usage: bin/gemlock [options] GEM_NAME-VERSION...

  Where options are:
    -v, --verbose                    Verbose output
    -s, --[no-]strict                Fail if unable to satisfy a dependency
    -h, --help                       Show this message
    -V, --version                    Show version
&lt;/pre&gt;
</description>
      <pubDate>Tue,  4 Apr 2006 16:20:31 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/17#page99</guid>
      <link>http://docs.rubygems.org/read/chapter/17#page99</link>
    </item>
    <item>
      <title>Jim Weirich: &lt;tt&gt;gemlock&lt;/tt&gt; script</title>
      <description>&lt;em&gt;(new in version 0.9.0)&lt;/em&gt;

The @gemlock@ script will generate a series of @require_gem@ commands that will lock down an application or library to a particular version of their dependent gems.

For example, if you wish to lock down a particular version of the Rails library, use:

  $ gemlock rails-1.0.0
  require "rubygems"
  require_gem 'rails', '= 1.0.0'
  require_gem 'rake', '= 0.7.0.1'
  require_gem 'activesupport', '= 1.2.5'
  require_gem 'activerecord', '= 1.13.2'
  require_gem 'actionpack', '= 1.11.2'
  require_gem 'actionmailer', '= 1.1.5'
  require_gem 'actionwebservice', '= 1.0.0'

@gemlock@ will find all the direct and indirect gems required by rails-1.0.0 and specify the most recent, currently installed version of those gems.  The output should be place in the application (or library) will it will be run *before* any other require statement in the program.

If your application depends on more than one gem, just list all the gems in the command line and @gemlock@ will display the locking commands for all of them.

h3. Usage

  Usage: bin/gemlock [options] GEM_NAME-VERSION...

  Where options are:
    -v, --verbose                    Verbose output
    -s, --[no-]strict                Fail if unable to satisfy a dependency
    -h, --help                       Show this message
    -V, --version                    Show version

</description>
      <pubDate>Tue,  4 Apr 2006 16:19:28 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/17#page99</guid>
      <link>http://docs.rubygems.org/read/chapter/17#page99</link>
    </item>
    <item>
      <title>Jim Weirich: &lt;tt&gt;gemlock&lt;/tt&gt; script</title>
      <description>The @gemlock@ script will generate a series of @require_gem@ commands that will lock down an application or library to a particular version of their dependent gems.

For example, if you wish to lock down a particular version of the Rails library, use:

  $ gemlock rails-1.0.0
  require "rubygems"
  require_gem 'rails', '= 1.0.0'
  require_gem 'rake', '= 0.7.0.1'
  require_gem 'activesupport', '= 1.2.5'
  require_gem 'activerecord', '= 1.13.2'
  require_gem 'actionpack', '= 1.11.2'
  require_gem 'actionmailer', '= 1.1.5'
  require_gem 'actionwebservice', '= 1.0.0'

@gemlock@ will find all the direct and indirect gems required by rails-1.0.0 and specify the most recent, currently installed version of those gems.  The output should be place in the application (or library) will it will be run *before* any other require statement in the program.

If your application depends on more than one gem, just list all the gems in the command line and @gemlock@ will display the locking commands for all of them.

h3. Usage


</description>
      <pubDate>Tue,  4 Apr 2006 16:18:16 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/17#page99</guid>
      <link>http://docs.rubygems.org/read/chapter/17#page99</link>
    </item>
    <item>
      <title>Jim Weirich: &lt;tt&gt;gemlock&lt;/tt&gt; script</title>
      <description>The @gemlock@ script will generate a series of @require_gem@ commands that will lock down an application or library to a particular version of their dependent gems.
</description>
      <pubDate>Tue,  4 Apr 2006 16:08:52 EDT</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/17#page99</guid>
      <link>http://docs.rubygems.org/read/chapter/17#page99</link>
    </item>
    <item>
      <title>Jim Weirich: No such file to load -- rubygems</title>
      <description>p{font-style: italic}. When I run the &lt;tt&gt;gem&lt;/tt&gt; command, I get the following error message:

&lt;pre&gt; ruby: No such file to load -- rubygems (LoadError)&lt;/pre&gt;

p{font-style: italic}. What's wrong?

h3. Answer

It looks like executing copy of Ruby does not have the RubyGems library installed.  RubyGems was probably installed at one time (because the &lt;tt&gt;gem&lt;/tt&gt; command is recognized), but it may have been installed on a different installation of Ruby than the one you are currently running.

h4. Things to check

* Check that the installation of Ruby that is running is the same one that has RubyGems installed.  On a unix system, the &lt;tt&gt;which&lt;/tt&gt; command (or &lt;tt&gt;type&lt;/tt&gt; command) will help figure this out.

* Verify that the currently running installation of Ruby does indeed have the RubyGems library installed.  You should find a "&lt;tt&gt;rubygems.rb&lt;/tt&gt;" file in the site_ruby/1.8 directory of the Ruby installation.

These mixup can easily happen after installing a new instance of Ruby, but the old instance preceeds the new one in the PATH list.</description>
      <pubDate>Thu, 29 Dec 2005 10:03:09 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page98</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page98</link>
    </item>
    <item>
      <title>Jim Weirich: No such file to load -- rubygems</title>
      <description>p{font-style: italic}. When I run the &lt;tt&gt;gem&lt;/tt&gt; command, I get the following error message: ruby: 

&lt;pre&gt;No such file to load -- rubygems (LoadError)&lt;/pre&gt;

p{font-style: italic}. What's wrong?

h3. Answer

It looks like executing copy of Ruby does not have the RubyGems library installed.  RubyGems was probably installed at one time (because the &lt;tt&gt;gem&lt;/tt&gt; command is recognized), but it may have been installed on a different installation of Ruby than the one you are currently running.

h4. Things to check

* Check that the installation of Ruby that is running is the same one that has RubyGems installed.  On a unix system, the &lt;tt&gt;which&lt;/tt&gt; command (or &lt;tt&gt;type&lt;/tt&gt; command) will help figure this out.

* Verify that the currently running installation of Ruby does indeed have the RubyGems library installed.  You should find a "&lt;tt&gt;rubygems.rb&lt;/tt&gt;" file in the site_ruby/1.8 directory of the Ruby installation.

These mixup can easily happen after installing a new instance of Ruby, but the old instance preceeds the new one in the PATH list.</description>
      <pubDate>Thu, 29 Dec 2005 10:02:21 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page98</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page98</link>
    </item>
    <item>
      <title>Jim Weirich: No such file to load -- rubygems</title>
      <description>p{font-style: italic}. When I run the &lt;tt&gt;gem&lt;/tt&gt; command, I get the following error message: ruby: 

&lt;pre&gt;No such file to load -- rubygems (LoadError)&lt;/pre&gt;

p{font-style: italic}. What's wrong?

h3. Answer


</description>
      <pubDate>Thu, 29 Dec 2005 09:54:38 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page98</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page98</link>
    </item>
    <item>
      <title>Jim Weirich: RubyGems hangs while updating the source index.</title>
      <description>p{font-style: italic}. I have a problem with RubyGems. It doesn't matter what I try to install with, it freezez.

p{font-style: italic}. Particulary I tried to execute:

    gem install rails --include-dependencies

p{font-style: italic}. but the command freezez at the following message:

    "Updating Gem source index for: http://gems.rubyforge.org"

h3. Answer

[I lost my internet connection while composing the answer to this question.  Unfortunately, I now no longer recall what I intended to write.  The answer (or at least part of the answer) is buried deep in the RubyGems mail archive.  I'll try to update this after a bit of research.  Sorry for leaving this question hanging.] 

</description>
      <pubDate>Tue, 20 Dec 2005 14:24:25 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page96</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page96</link>
    </item>
    <item>
      <title>Jim Weirich: RubyGems hangs while updating the source index.</title>
      <description>p{font-style: italic}. I have a problem with RubyGems. It doesn't matter what I try to install with, it freezez.

p{font-style: italic}. Particulary I tried to execute:
    gem install rails --include-dependencies

p{font-style: italic}. but the command freezez at the following message:

    "Updating Gem source index for: http://gems.rubyforge.org"

h3. Answer

[I lost my internet connection while composing the answer to this question.  Unfortunately, I now no longer recall what I intended to write.  The answer (or at least part of the answer) is buried deep in the RubyGems mail archive.  I'll try to update this after a bit of research.  Sorry for leaving this question hanging.] 

</description>
      <pubDate>Tue, 20 Dec 2005 14:23:55 EST</pubDate>
      <guid>http://docs.rubygems.org/read/chapter/19#page96</guid>
      <link>http://docs.rubygems.org/read/chapter/19#page96</link>
    </item>
  </channel>
</rss>
