Error after install

C

Callen Mascarenhas

I installed Ruby on my RHEL 3 system. I did the following:
/configure
make
make test
make install

No errors in the whole process. Now when I try to run irb in
/usr/local/bin/irb I'm gettin the following error:

$ . /usr/local/bin/irb
-bash: require: command not found
-bash: /usr/local/bin/irb: line 13: syntax error near unexpected token
`__FILE__'
-bash: /usr/local/bin/irb: line 13: ` IRB.start(__FILE__)'

Do I need to set up some $PATH info??? Or links to any shared
libraries??? There was nothing said in the ruby-lang.orb site.

Thanks in advance for you help
Callen.
 
B

brabuhr

Now when I try to run irb in
/usr/local/bin/irb I'm gettin the following error:

$ . /usr/local/bin/irb ^
-bash: require: command not found
-bash: /usr/local/bin/irb: line 13: syntax error near unexpected token
`__FILE__'
-bash: /usr/local/bin/irb: line 13: ` IRB.start(__FILE__)'

Instead of:
. /usr/local/bin/irb
do:
/usr/local/bin/irb
 
C

Callen Mascarenhas

unknown said:
Instead of:
. /usr/local/bin/irb
do:
/usr/local/bin/irb

when I do that and then run `which` I get the following.

$ which irb
/opt/third-party/bin/irb

That is why I'm using the . /usr/local/bin/irb command. Am I not using
it correctly.

Thanks for your reply.
 
J

Justin Collins

Callen said:
when I do that and then run `which` I get the following.

$ which irb
/opt/third-party/bin/irb

That is why I'm using the . /usr/local/bin/irb command. Am I not using
it correctly.

Thanks for your reply.

Don't use the period at the beginning, that is what is screwing it up:

$ . /usr/bin/irb
bash: require: command not found
bash: /usr/bin/irb: line 13: syntax error near unexpected token `__FILE__'
bash: /usr/bin/irb: line 13: ` IRB.start(__FILE__)'
$ /usr/bin/irb
irb(main):001:0>


-Justin
 
B

Brian Candler

Callen said:
when I do that and then run `which` I get the following.

$ which irb
/opt/third-party/bin/irb

That is why I'm using the . /usr/local/bin/irb command. Am I not using
it correctly.

No. A dot followed by a filename means "read this file into the shell" -
that is, it is treated as a series of bash commands.

Just doing /usr/local/bin/irb (without the dot) will execute that
command.
 
C

Callen Mascarenhas

Brian said:
No. A dot followed by a filename means "read this file into the shell" -
that is, it is treated as a series of bash commands.

Just doing /usr/local/bin/irb (without the dot) will execute that
command.

Thanks guys for replying.

The reason I'm using the ". /usr/local/bin/irb" is because I have
another company version of irb/ruby in /opt/third-party/bin/ and they
have removed the 'gem' command. So I cannot install new features and
play with Ruby.

And if you look at the commands it is using the wrong irb i.e. the one
in /opt/third-party/bin/ which doesn't have the gem command and not the
one I just installed. I hope this explains my predicament more clearly.
 
H

Hassan Schroeder

The reason I'm using the ". /usr/local/bin/irb" is because I have
another company version of irb/ruby in /opt/third-party/bin/ and they
have removed the 'gem' command. So I cannot install new features and
play with Ruby.

You've already been told: the '.' is wrong, whether it's './' or '. /' -- so
don't use it.

Entering /usr/local/bin/irb will use that exact version, and no, it won't
change the result of `which irb` -- irrelevant.

If you want to use your personal version all the time, change the PATH
defined in .bashrc (or wherever) to put /usr/local/bin *first*, or at least
before /opt/third-party/bin.

HTH,
 
C

Callen Mascarenhas

Hassan said:
You've already been told: the '.' is wrong, whether it's './' or '. /'
-- so
don't use it.

Entering /usr/local/bin/irb will use that exact version, and no, it
won't
change the result of `which irb` -- irrelevant.

If you want to use your personal version all the time, change the PATH
defined in .bashrc (or wherever) to put /usr/local/bin *first*, or at
least
before /opt/third-party/bin.

HTH,

I guess I didn't really understand how the 'which' command worked.
Thanks for making things clear for me.

So out of curiosity, how come 'which' is pulling up the irb in
/opt/third-party/bin?? Is it because that is the first one in PATH ???
I know this is a Unix question. But if someone can help, I can only be
grateful :).
 
T

Tim Hunter

Callen said:
So out of curiosity, how come 'which' is pulling up the irb in
/opt/third-party/bin?? Is it because that is the first one in PATH ???
I know this is a Unix question. But if someone can help, I can only be
grateful :).

At a command line type "man which". It'll explain to you exactly how the
which command works.
 
H

Hassan Schroeder

So out of curiosity, how come 'which' is pulling up the irb in
/opt/third-party/bin?? Is it because that is the first one in PATH ???

Exactly. Hence my suggestion that, if you want a different version to
be your own default, change your PATH.
 
C

Callen Mascarenhas

Hassan said:
Exactly. Hence my suggestion that, if you want a different version to
be your own default, change your PATH.

Thanks guys for all your help. I'll be back with more questions soon.
But I'm good for now. Go Ruby!!!!
 

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

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,536
Latest member
VeldaYoung

Latest Threads

Top