0

When I try to setup ruby gems on Windows 7 using http://rubyinstaller.org/:

ruby setup.rb

I get the following error

C:/rubygems-2.4.5/lib/rubygems.rb:1239:in `<top (required)>': uninitialized constant Gem::Specification (NameError)
    from setup.rb:32:in `require'
    from setup.rb:32:in `<main>'

How can I resolve this issue? I've tried using Ruby 2.1.5 and 1.9.3-p551.

Edit

C:\>ruby -version
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)

The path environment variable is set to C:\Ruby21\bin.

3
  • 1
    In cmd, show us the output of which ruby and which gem Commented Feb 4, 2015 at 19:36
  • What's this setup.rb you're trying to run? Rubygems is part of the ruby standard library in ruby 2.0 and higher so you don't need to install it separately Commented Feb 5, 2015 at 16:33
  • Check if this link helps you. stackoverflow.com/questions/18908708/… Commented Feb 9, 2015 at 15:15

2 Answers 2

1

I believe James is trying to install the rubygems following the instructions provided in RubyGems.org

RubyInstaller had already installed rubygems for you so you don't need to to anything, you are ready to use Ruby!

If you are trying to create a gem, then you just have to follow the guide in http://guides.rubygems.org/make-your-own-gem/ but I believe you are just trying to use Ruby in Windows and if that is the case you don't need to create any gems neither install rubygems.

By the way, you have typed ruby -version but you should have either type ruby -v or ruby --version (double --) to see the version.

Sign up to request clarification or add additional context in comments.

Comments

0

If you're just starting with rails, i d suggest using a different environment other than windows. You will continuously run into problems where gems cannot access your gnu compiler, things like unicorn server won't work. Download virtual box, and install fedora ssh server on it, then use putty to connect to your ruby environment. Set up vim with a rails plug in and u ll be good 2 go.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.