[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Error after install

Callen Mascarenhas

12/23/2008 3:53:00 AM

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.
--
Posted via http://www.ruby-....

10 Answers

brabuhr

12/23/2008 4:00:00 AM

0

> 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

Callen Mascarenhas

12/23/2008 4:19:00 AM

0

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.
--
Posted via http://www.ruby-....

Justin Collins

12/23/2008 8:29:00 AM

0

Callen Mascarenhas wrote:
> 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.
>

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

Brian Candler

12/23/2008 8:47:00 AM

0

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.
--
Posted via http://www.ruby-....

Callen Mascarenhas

12/23/2008 5:54:00 PM

0

Brian Candler 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.
--
Posted via http://www.ruby-....

Hassan Schroeder

12/23/2008 6:36:00 PM

0

On Tue, Dec 23, 2008 at 9:53 AM, Callen Mascarenhas
<callenmas@justice.com> 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 Schroeder ------------------------ hassan.schroeder@gmail.com

Callen Mascarenhas

12/23/2008 7:12:00 PM

0

Hassan Schroeder wrote:
> On Tue, Dec 23, 2008 at 9:53 AM, Callen Mascarenhas
> <callenmas@justice.com> 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 :).
--
Posted via http://www.ruby-....

Tim Hunter

12/23/2008 7:39:00 PM

0

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.

--
RMagick: http://rmagick.ruby...

Hassan Schroeder

12/23/2008 7:43:00 PM

0

On Tue, Dec 23, 2008 at 11:11 AM, Callen Mascarenhas
<callenmas@justice.com> 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.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Callen Mascarenhas

12/24/2008 1:04:00 AM

0

Hassan Schroeder wrote:
> On Tue, Dec 23, 2008 at 11:11 AM, Callen Mascarenhas
> <callenmas@justice.com> 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!!!!

--
Posted via http://www.ruby-....