Jump to: navigation, search

Difference between revisions of "RubyGems"

(Initial revision on how to install Ruby and RubyGems for requirements to other OpenStack software or apis)
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<p>The following sections provide basic information about installing Ruby and [[RubyGems]] on Windows as well as Linux computers from a few vendors and 'How to Access and Update' Ruby and [[RubyGems]] on OS X 10.5+.</p>
+
The following sections provide basic information about installing Ruby and [[RubyGems]] on Windows as well as Linux computers from a few vendors and 'How to Access and Update' Ruby and [[RubyGems]] on OS X 10.4+ from Apple and 3rd Parties.
  
<h3 id="win">Windows</h3>
+
===Ubuntu===
<p>Download and install <a href="http://www.rubyinstaller.org/" title="ruby installer for windows">Ruby Installer for Windows</a>. The installer already includes [[RubyGems]].</p>
 
  
<p>Be sure you use the Ruby-enabled command prompt window when you later install and use <code>vmc</code>.  You access this command prompt from the Windows Start menu (<strong>All Programs &gt; Ruby &lt;version&gt; &gt; Start Command Prompt with Ruby</strong>).</p>
+
<p>Open up the 'Software Center' app from your launcher and type in `[[RubyGems]]` without quotes into the application search box at the
 +
top right, and press [enter]. [[RubyGems]] then can be installed by just clicking on the button labeled 'Install', thats it. Be sure to
 +
Follow any extra instructions from the Software Center should there be any during or after installation.</p>
 +
''Alternatively you can install from a terminal as well, use the <code>apt-get</code> command-line tool to install Ruby and [[RubyGems]], as shown below.''
  
<p>Finally, update [[RubyGems]] from the Ruby Command Prompt:</p>
+
* Install the full Ruby package and [[RubyGems]]: <code>prompt$ sudo apt-get install ruby-full rubygems</code>
 +
- Consult your system administrator for any required authentication credentials for the <code>sudo</code> command that may required.
  
<pre><code>prompt&gt; gem update --system
+
====Debian Linux====
</code></pre>
+
* ''Same steps and options as Ubuntu above for the Alternative install method, or GUI Using '''Synaptic''' package manager instead of Software Center.''
 
 
<h3 id="mac">Mac OS X</h3>
 
<p>Version 10.5 and higher of Mac OS X already ships with Ruby and [[RubyGems]] installed.</p>
 
  
<p>If you are using an earlier version of Mac OS, try following any directions at <a href="http://rubygems.org/pages/download">[[RubyGems]]</a> to see if your version is still supported unofficially.</p>
+
===Mac OS X===
 +
Mac's with version 10.5 Leopard or higher already have Ruby and [[RubyGems]] installed, Ruby and [[RubyGems]] update instructions are [http://homebrew.github.com|found here] at the Homebrew for OS X page, as well as instructions for adding Homebrew to your OS X machine if you do not already have it installed.
  
<h2 id="ubu">Ubuntu</h2>
+
If you are using an earlier version of Mac OS like 10.3 or 10.4, try following any directions at <a href="http://rubygems.org/pages/download">[[RubyGems]]</a> to see if your version is still supported officially or not, plus there many community workarounds and tips for those wishing to still make use of OS X or Pure Darwin sometimes registers here too on older machines or newer machines both.
  
<p>Open up the 'Software Center' app from your launcher and type in `[[RubyGems]]` without quotes into the application search box at the top right, and press [enter]. [[RubyGems]] then can be installed by just clicking on the button labeled 'Install', thats it. Follow any extra instructions from the Software Center should there be any during or after installation.</p>
+
Test to ensure that the '''gem''' command is in your path: '''$ which gem'''
<p>Alternatively you can install from a terminal as well, use the <code>apt-get</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
 
  
<ol>
+
If the command is not found, then update your <code>PATH</code> variable accordingly.  For example, you can update your <code>.bashrc</code> file with the following line:
<li>
+
<code>export PATH=$PATH:/var/lib/gems/1.8/bin</code>
    <p>Install the full Ruby package and [[RubyGems]]:</p>
 
  
    <p><code>prompt$ sudo apt-get install ruby-full rubygems</code></p>
+
===Windows===
 +
Download and install <a href="http://www.rubyinstaller.org/" title="ruby installer for windows">Ruby Installer for Windows</a>. The installer already includes [[RubyGems]].
  
    <p>Consult your system administrator for any required authentication credentials for the <code>sudo</code> command.</p>
+
Be sure you use the Ruby-enabled command prompt window when you later install and use <code>vmc</code>.  You access this command prompt from the Windows Start menu (<strong>All Programs &gt; Ruby &lt;version&gt; &gt; Start Command Prompt with Ruby</strong>).
   </li>
 
  <li>
 
    <p>Test to ensure that the <code>gem</code> command is in your path:</p>
 
  
    <p><code>prompt$ which gem</code></p>
+
Finally, update [[RubyGems]] from the Ruby Command Prompt:
  
    <p>If the command is not found, then update your <code>PATH</code> variable accordingly.  For example, you can update your <code>.bashrc</code> file with the following line:</p>
+
<pre><code>prompt&gt; gem update --system
 
 
    <p><code>export PATH=$PATH:/var/lib/gems/1.8/bin</code></p>
 
  </li>
 
  <li>
 
    <p>Update [[RubyGems]]:</p>
 
 
 
    <p>Ubuntu 10.04</p>
 
 
 
    <pre><code>prompt$ sudo gem install rubygems-update
 
prompt$ sudo /var/lib/gems/1.8/bin/update_rubygems
 
 
</code></pre>
 
</code></pre>
  
    <p>Ubuntu 11.10</p>
+
===[[RedHat]] Linux===
 
 
    <pre><code>prompt$ sudo su -
 
prompt# export REALLY_GEM_UPDATE_SYSTEM=true
 
prompt# gem update --system
 
prompt# exit
 
</code></pre>
 
  </li>
 
</ol><h3 id="rhel">[[RedHat]]</h3>
 
  
 
<p>From a terminal, use the <code>yum</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
 
<p>From a terminal, use the <code>yum</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
  
 
<ol>
 
<ol>
<li>
+
*
 
     <p>Install Ruby:</p>
 
     <p>Install Ruby:</p>
  
 
     <p><code>prompt$ sudo yum install ruby</code></p>
 
     <p><code>prompt$ sudo yum install ruby</code></p>
  </li>
+
 
  <li>
+
*
 
     <p>If you are using [[RedHat]] Enterprise Linux 6, enable the <em>Optional</em> channel for your host by logging into <a href="https://rhn.redhat.com/">Red Hat Network (RHN)</a>.</p>
 
     <p>If you are using [[RedHat]] Enterprise Linux 6, enable the <em>Optional</em> channel for your host by logging into <a href="https://rhn.redhat.com/">Red Hat Network (RHN)</a>.</p>
  </li>
+
 
  <li>
+
*
 
     <p>Install [[RubyGems]]:</p>
 
     <p>Install [[RubyGems]]:</p>
  
 
     <p><code>prompt$ sudo yum install rubygems</code></p>
 
     <p><code>prompt$ sudo yum install rubygems</code></p>
  </li>
+
 
</ol><h3 id="sue">SuSE</h3>
+
</ol>
 +
===SuSE Linux===
  
 
<p>From a terminal, use the <code>yast</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
 
<p>From a terminal, use the <code>yast</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
  
 
<ol>
 
<ol>
<li>
+
*
 
     <p>Install Ruby:</p>
 
     <p>Install Ruby:</p>
  
 
     <p><code>prompt$ yast -i ruby</code></p>
 
     <p><code>prompt$ yast -i ruby</code></p>
  </li>
+
 
  <li>
+
*
 
     <p>Install [[RubyGems]]:</p>
 
     <p>Install [[RubyGems]]:</p>
  
 
     <p><code>prompt$ yast -i rubygems</code></p>
 
     <p><code>prompt$ yast -i rubygems</code></p>
  </li>
 
</ol><h3 id="deb">Debian</h3>
 
 
<p>You use Ruby Version Manager (<code>rvm</code>) to install Ruby and [[RubyGems]] on Debian.  The following procedure shows how to install <code>rvm</code> if you have not already done so.</p>
 
 
<ol>
 
<li>
 
    <p>Use the following <code>apt-get</code> command-line tool to install the required packages:</p>
 
 
    <p><code>prompt$ sudo apt-get install gcccurl git-core build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev</code></p>
 
  </li>
 
  <li>
 
    <p>Run the <code>bash</code> script to install <code>rvm</code> from <a href="https://rvm.beginrescueend.com/install/rvm">Ruby Version Manager</a>.</p>
 
 
    <p><code>prompt$ bash &lt;&lt; curl -s https://rvm.beginrescueend.com/install/rvm</code></p>
 
  </li>
 
  <li>
 
    <p>Edit your <em>~/.bashrc</em> file as described by the RVM installation in the precding step.</p>
 
  </li>
 
  <li>
 
    <p>Use <code>rvm</code> to install Ruby and [[RubyGems]] as shown:</p>
 
 
    <p><code>prompt$ rvm package install zlib</code></p>
 
 
    <p><code>prompt$ rvm install 1.9.2 -C --with-zlib-dir=$rvm_path/usr</code></p>
 
  
    <p><code>prompt$ rvm use 1.9.2</code></p>
 
  </li>
 
 
</ol>
 
</ol>
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 

Revision as of 09:39, 24 April 2012

The following sections provide basic information about installing Ruby and RubyGems on Windows as well as Linux computers from a few vendors and 'How to Access and Update' Ruby and RubyGems on OS X 10.4+ from Apple and 3rd Parties.

Ubuntu

Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it. Be sure to Follow any extra instructions from the Software Center should there be any during or after installation.

Alternatively you can install from a terminal as well, use the apt-get command-line tool to install Ruby and RubyGems, as shown below.

  • Install the full Ruby package and RubyGems: prompt$ sudo apt-get install ruby-full rubygems
- Consult your system administrator for any required authentication credentials for the sudo command that may required.

Debian Linux

  • Same steps and options as Ubuntu above for the Alternative install method, or GUI Using Synaptic package manager instead of Software Center.

Mac OS X

Mac's with version 10.5 Leopard or higher already have Ruby and RubyGems installed, Ruby and RubyGems update instructions are here at the Homebrew for OS X page, as well as instructions for adding Homebrew to your OS X machine if you do not already have it installed.

If you are using an earlier version of Mac OS like 10.3 or 10.4, try following any directions at <a href="http://rubygems.org/pages/download">RubyGems</a> to see if your version is still supported officially or not, plus there many community workarounds and tips for those wishing to still make use of OS X or Pure Darwin sometimes registers here too on older machines or newer machines both.

Test to ensure that the gem command is in your path: $ which gem

If the command is not found, then update your PATH variable accordingly. For example, you can update your .bashrc file with the following line: export PATH=$PATH:/var/lib/gems/1.8/bin

Windows

Download and install <a href="http://www.rubyinstaller.org/" title="ruby installer for windows">Ruby Installer for Windows</a>. The installer already includes RubyGems.

Be sure you use the Ruby-enabled command prompt window when you later install and use vmc. You access this command prompt from the Windows Start menu (All Programs > Ruby <version> > Start Command Prompt with Ruby).

Finally, update RubyGems from the Ruby Command Prompt:

<code>prompt> gem update --system
</code>

RedHat Linux

From a terminal, use the yum command-line tool to install Ruby and RubyGems, as shown below.

    Install Ruby:

    prompt$ sudo yum install ruby

    If you are using RedHat Enterprise Linux 6, enable the Optional channel for your host by logging into <a href="https://rhn.redhat.com/">Red Hat Network (RHN)</a>.

    Install RubyGems:

    prompt$ sudo yum install rubygems

SuSE Linux

From a terminal, use the yast command-line tool to install Ruby and RubyGems, as shown below.

    Install Ruby:

    prompt$ yast -i ruby

    Install RubyGems:

    prompt$ yast -i rubygems