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)
 
m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__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>
 
  
<h3 id="win">Windows</h3>
+
This Page provides basic information about installing Ruby and [[RubyGems]] on various platforms ( ''the recommended way to install it via each platform is listed below instead of every possible way to install it. Check for Alternative methods at the links provided or others acquired by any other means.'' ).
<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>
+
= 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.''
  
<p>Finally, update [[RubyGems]] from the Ruby Command Prompt:</p>
+
* Install the full Ruby package and [[RubyGems]]: '''$ sudo apt-get install ruby-full rubygems'''
 +
  - Consult your system administrator for any required authentication credentials for the '''sudo''' command that may required.
  
<pre><code>prompt&gt; gem update --system
+
'''Debian Linux''' * ''Ubuntu is built onto of a Debian foundation, so the same steps and options as Ubuntu above for the Alternative install method, or by GUI using a Debian graphical package manager such as "Synaptic" instead of Software Center, or by what ever other means you tend to normally add and remove installed from your Debian system, thats well past the scope of this wiki page, for further help with installing software on Debian you can begin [http://help.debian.org reading here] and/or join Debian's support channel for real time text group chat with individuals willing to help you if they are able. [[irc://irc.oftc.net/#debian|Debian on OFTC '''Internet Relay Chat''' Link Address]]''
</code></pre>
 
  
<h3 id="mac">Mac OS X</h3>
+
= Mac OS X =
<p>Version 10.5 and higher of Mac OS X already ships with Ruby and [[RubyGems]] installed.</p>
+
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.
  
<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>
+
If you are using an earlier version of Mac OS like 10.3 or 10.4, try following any directions at [http://rubygems.org/pages/download RubyGems] 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.
  
<h2 id="ubu">Ubuntu</h2>
+
Test to ensure that the '''gem''' command is in your path: '''$ which gem'''
  
<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>
+
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'''
<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>
+
= Windows =
<li>
+
Download and install [http://www.rubyinstaller.org Ruby Installer for Windows]. The installer already includes [[RubyGems]].
    <p>Install the full Ruby package and [[RubyGems]]:</p>
 
  
    <p><code>prompt$ sudo apt-get install ruby-full rubygems</code></p>
+
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''').
  
    <p>Consult your system administrator for any required authentication credentials for the <code>sudo</code> command.</p>
+
Finally, update [[RubyGems]] from the Ruby Command Prompt:'''prompt> gem update --system'''
  </li>
 
  <li>
 
    <p>Test to ensure that the <code>gem</code> command is in your path:</p>
 
  
    <p><code>prompt$ which gem</code></p>
+
= RedHat Linux =
 +
From a terminal, use the ''yum'' command-line tool to install Ruby and [[RubyGems]].
 +
Install Ruby like shown below:
  
    <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>
+
'''$ sudo yum install ruby'''
  
    <p><code>export PATH=$PATH:/var/lib/gems/1.8/bin</code></p>
+
If you are using RedHat Enterprise Linux 6, enable the ''Optional'' channel for your host by logging into [https://rhn.redhat.com Red Hat Network (RHN)].
  </li>
 
  <li>
 
    <p>Update [[RubyGems]]:</p>
 
  
    <p>Ubuntu 10.04</p>
+
Install [[RubyGems]]:
  
    <pre><code>prompt$ sudo gem install rubygems-update
+
'''$ sudo yum install rubygems'''
prompt$ sudo /var/lib/gems/1.8/bin/update_rubygems
 
</code></pre>
 
  
    <p>Ubuntu 11.10</p>
+
= SuSE Linux =
 +
From a terminal, use the ''yast'' command-line tool to install Ruby and [[RubyGems]].
 +
Install Ruby and [[RubyGems]] like shown below:
  
    <pre><code>prompt$ sudo su -
+
'''$ yast -i ruby'''
prompt# export REALLY_GEM_UPDATE_SYSTEM=true
+
'''$ yast -i rubygems'''
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>
 
 
 
<ol>
 
<li>
 
    <p>Install Ruby:</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>
 
  </li>
 
  <li>
 
    <p>Install [[RubyGems]]:</p>
 
 
 
    <p><code>prompt$ sudo yum install rubygems</code></p>
 
  </li>
 
</ol><h3 id="sue">SuSE</h3>
 
 
 
<p>From a terminal, use the <code>yast</code> command-line tool to install Ruby and [[RubyGems]], as shown below.</p>
 
 
 
<ol>
 
<li>
 
    <p>Install Ruby:</p>
 
 
 
    <p><code>prompt$ yast -i ruby</code></p>
 
  </li>
 
  <li>
 
    <p>Install [[RubyGems]]:</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>
 
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 
</div>
 

Latest revision as of 22:50, 21 June 2016

This Page provides basic information about installing Ruby and RubyGems on various platforms ( the recommended way to install it via each platform is listed below instead of every possible way to install it. Check for Alternative methods at the links provided or others acquired by any other means. ).

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: $ 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 * Ubuntu is built onto of a Debian foundation, so the same steps and options as Ubuntu above for the Alternative install method, or by GUI using a Debian graphical package manager such as "Synaptic" instead of Software Center, or by what ever other means you tend to normally add and remove installed from your Debian system, thats well past the scope of this wiki page, for further help with installing software on Debian you can begin reading here and/or join Debian's support channel for real time text group chat with individuals willing to help you if they are able. [on OFTC Internet Relay Chat Link Address]

Mac OS X

Mac's with version 10.5 Leopard or higher already have Ruby and RubyGems installed, Ruby and RubyGems update instructions are 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.

If you are using an earlier version of Mac OS like 10.3 or 10.4, try following any directions at RubyGems 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 Ruby Installer for Windows. 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:prompt> gem update --system

RedHat Linux

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

$ sudo yum install ruby

If you are using RedHat Enterprise Linux 6, enable the Optional channel for your host by logging into Red Hat Network (RHN).

Install RubyGems:

$ sudo yum install rubygems

SuSE Linux

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

$ yast -i ruby $ yast -i rubygems