Help with RubyGems

  • Thread starter Institute For human continuity
  • Start date
I

Institute For human continuity

I am new to Ruby and programming, so please bear with me.

I installed RubyGems 1.4 and when I tried some commands in IRB, it did
not work.

When I input "gem query", it returns:

"NameError: undefined local variable or method 'query' for main:Object"

What am I doing wrong?
 
P

Phillip Gawlowski

I am new to Ruby and programming, so please bear with me.

I installed RubyGems 1.4 and when I tried some commands in IRB, it did
not work.

When I input "gem query", it returns:

"NameError: undefined local variable or method 'query' for main:Object"

What am I doing wrong?

Did you install RubyGems with Ruby 1.9 (ruby -v)?

If so, it's probably best to just reinstall (from scratch) at this
point, especially if it is a fresh install.

--
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.
 
T

Thomas Preymesser

[Note: parts of this message were removed to make it a legal post.]

On 7 January 2011 17:09, Institute For human continuity <
I am new to Ruby and programming, so please bear with me.

I installed RubyGems 1.4 and when I tried some commands in IRB, it did
not work.

When I input "gem query", it returns:

"NameError: undefined local variable or method 'query' for main:Object"

What am I doing wrong?

you have to type your gem-commands in the command line not in irb.

-Thomas
 
I

Institute For human continuity

Thomas Preymesser wrote in post #973179:
On 7 January 2011 17:09, Institute For human continuity <

you have to type your gem-commands in the command line not in irb.

-Thomas

No response from cmd when I try it.
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

On 7 January 2011 17:09, Institute For human continuity <

you have to type your gem-commands in the command line not in irb.

-Thomas

No response from cmd when I try it.
[/QUOTE]

There seems to be context confusion, it is expected that you are in a
certain place (the terminal) when you type "gem query", but presumably you
are somewhere else (such as irb), or gem isn't in your path, but from "no
response from cmd" it sounds like you might be on Windows, because the
Windows terminal is named "cmd.exe" (IIRC), but I'm not sure if that is
really what you are saying, maybe you mean the query command isn't working.

Can you take a screen-shot of what you are trying to do, so that we can see
the context of your problem? If you are on Windows, the printscrn key should
do it, then open MSPaint and paste the image into there and save it as a
jpeg; if on Mac, Command+Shift+4, and click in the upper left of what you
want to capture, then drag to lower right; IDK for Linux. You can then host
the image on imageshack.us and post a link.
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

On Sat, Jan 15, 2011 at 6:35 PM, Institute For human continuity <
I am using cmd.exe on Windows.
Then it sounds like your gem application is not added to your path. When you
run a command like "gem", your terminal figures out what that means by
looking through a set of folders until it finds a program with the same
name. Then it lets that program handle whatever you typed in on the command
line. The way it determines which folders to look through is by examining a
variable called your path (in *nix, you can type 'echo $PATH' to see it).

I don't know enough about Windows to know how to fix this, but this tutorial
looks very good, and should have everything you need, to get the gem command
working http://www.voidspace.org.uk/python/articles/command_line.shtml#pathIt
shows how to fix Python, if it has this issue, but I'd expect it to be
exactly the same for rubygems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top