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.
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
unknown wrote:
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
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.
Callen Mascarenhas wrote:
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.
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.
Brian C. wrote:
Callen Mascarenhas wrote:
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.
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.
Callen Mascarenhas wrote:
-bash: /usr/local/bin/irb: line 13: syntax error near unexpected token
$ 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
Hassan S. wrote:
On Tue, Dec 23, 2008 at 9:53 AM, Callen Mascarenhas
[email protected] wrote:
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,
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 :).
Callen Mascarenhas wrote:
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.
On Tue, Dec 23, 2008 at 11:11 AM, Callen Mascarenhas
[email protected] wrote:
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.
On Tue, Dec 23, 2008 at 9:53 AM, Callen Mascarenhas
[email protected] wrote:
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,
Hassan S. wrote:
On Tue, Dec 23, 2008 at 11:11 AM, Callen Mascarenhas
[email protected] wrote:
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.
Thanks guys for all your help. I’ll be back with more questions soon.
But I’m good for now. Go Ruby!!!