Installing Ruby Gems

James's Avatar

James

25 Jun, 2011 05:42 AM

All,

I'm a BRAND new to programming and am having a hard time installing Ruby Gems. I'm following Michael Hartl's Ruby on Rails tutorial and got stuck when I tried to download RubyGems.

After I download RubyGems and extract the file. I double-click on 'setup.rb' and Windows 7 returns an error that it doesn't know what application to use to open the file.

From the YouTube videos I've watched it looks like a cmd window should open but one does not.

Any help?

Thanks!

  1. Support Staff 1 Posted by Luis Lavena on 25 Jun, 2011 11:58 AM

    Luis Lavena's Avatar

    Hello James,

    Dunno which tutorial you're following (you didn't provided a link to it) but:

    RubyInstaller, the modern Ruby distribution for Windows already includes RubyGems. You can verify that from the command line typing gem --version

    You can't install RubyGems by double-click on setup.rb for lot of reasons, one is that during the installation of RubyInstaller you didn't check the box that says "associate .rb and .rbw with Ruby"

    Second, you can't install RubyGems that way because it needs to run in the command prompt.

    With RubyInstaller came a command prompt named Start Command Prompt with Ruby which will add Ruby to the PATH and allow you interact with the command line with it.

    It is expected you know a bit more about command line to interact with Ruby and to install components.

    Let us know if the above helps you or not. Also, please include more specific details when reporting issues or looking for help, that will help us help you better.

  2. 2 Posted by Daniel on 27 Jun, 2011 06:12 PM

    Daniel's Avatar

    Hello James and Luis,

    i have the same problem here. I'm running Windows 7 and I've just installed Ruby 1.9.2. After typing gem --version to the interactive Ruby command line, i just got the following message back:

    NameError: undefined local variable or method 'version' for main:Objekt
    from (irb):1
    from C:/Ruby192/bin/irb:12:in '''

    i am not new to programming but new to ruby! I would like to code something in rails so i hope to find some help here to install all this stuff!
    it is not easy to find a simple guide to install ruby + RubyGems + Rails on a windows system.

    is it right that RubyGems is required to install Rails?
    This is the stuff i downloaded allready:

    Ruby: http://rubyforge.org/frs/?group_id=167 (Windows executable)
    RubyGems: http://rubyforge.org/frs/?group_id=126 (1.8.5. .zip)
    Rails: http://rubyforge.org/frs/?group_id=307 (2.3.3. Zip)

  3. Support Staff 3 Posted by Luis Lavena on 27 Jun, 2011 08:36 PM

    Luis Lavena's Avatar

    David,

    gem --version needs to be typed in the command prompt, not the Ruby Interactive console.

    For RubyInstaller downloads, you don't need to download RubyGems separately... I mentioned that before.

    For Rails, you need to install the gem from Command Prompt with Ruby and not the Ruby Interactive console.

    If you want to start and try Ruby, particularly Rails, download RailsInstaller for a self-contained environment:

    http://railsinstaller.org/

  4. 4 Posted by marthinus on 08 Feb, 2014 03:13 PM

    marthinus's Avatar

    hello i have aa problem wen i open the command prompt an tells it to update a php index it tells me permission denied what must i do to prevent it..

  5. Support Staff 5 Posted by Nick Quaranto on 16 Apr, 2014 08:01 PM

    Nick Quaranto's Avatar

    Doesn't sound like a rubygems.org issue. Closing!

  6. Nick Quaranto closed this discussion on 16 Apr, 2014 08:01 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac