I’ve just found the following line in my ~/.bashrc:
PATH=$PATH:~/.gem/ruby/1.8/bin
Now, that’s vey beautiful. Instead of cluttering /usr/bin, everythig
goes in ~/.gem/ruby/1.8/bin.
But I wonder. Who added this line to my ~/.bashrc? I doubt it’s me,
because, IIRC, just today I discovered the fact the RubyGems puts
binaries there.
I bet it was you, unless someone else installed ruby-gems ;).
I agree however that there might be better solutions than to pollute
your PATH environement variable. But as I am unable to provide one I
will certainly not complain.
BTW IIANM this does not happen in 1.9 anymore.
Cheers
Robert
–
Si tu veux construire un bateau …
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.
If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.
because, IIRC, just today I discovered the fact the RubyGems puts binaries
there.
It wasn’t RubyGems, however RubyGems does warn you if you have
–user-install (current default) and don’t have the user bin for in your
PATH.
Eric I did not think of RubyGems, but rather of the gem itself. Do you
think this is possible?
Cheers
Robert
–
Si tu veux construire un bateau …
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.
If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.
Now, that’s vey beautiful. Instead of cluttering /usr/bin, everythig
Eric I did not think of RubyGems, but rather of the gem itself. Do you
think this is possible?
It’s possible, but it wouldn’t happen at install time.
I guess it is really time for me to learn about Rubygems I was
convinced that gem install can run post install hooks which could do
about anything in the system.
If you have a safety net about this, well I’am impressed.
Cheers
Robert
–
Si tu veux construire un bateau …
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.
If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.
I reread the OP again and again, because it is obvious (to me now)
that Eric and you assume that OP did just install Rubygems. He did not
say so. I still have this strange feeling that some gem did this to
him. Maybe one he was writing himself?
Cheers
Robert
–
Si tu veux construire un bateau …
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.
If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.
I hope that a gem author would
not do something so obviously dangerous
After thinking more about this, I think there’s 70% probablity that it
was I who added that line to that file. It’s just that I don’t remember
this. I do remember that I was writing a certain gem that had an
executable I experimented with. So let’s make it a 85% probability.
And since it’s hard to believe any alien script would add that line,
we’ll have to conclude that it is indeed my own handiwork.
How about “ls -l .bashrc” to see when it was last changed?
I tried that, but I might have edited that file since.
I’d better put all my config file in a git repository.
If a nefarious gem is suspected of making this change, then he can
probably find it using a variant of
grep -R bashrc /usr/lib/ruby/gems/1.8
(I cleaned up my system, so many of the gems I had aren’t there
anymore.)
I reread the OP again and again, because it is obvious (to me now)
that Eric and you assume that OP did just install Rubygems. He did not
say so. I still have this strange feeling that some gem did this to
him. Maybe one he was writing himself?
He didn’t say he’d only just installed RubyGems, but he did say that
he’d only just noticed this extension to his PATH in .bashrc. The fact
that he’d only just noticed it doesn’t necessarily mean that it hasn’t
been there all the time since he installed RubyGems.
How about “ls -l .bashrc” to see when it was last changed? (Not valid if
he’s been editing it manually of course)
Now, if he had installed RubyGems via the system’s package management
system, then I agree it could have touched /etc/bashrc but would be very
unlikely to touch ~/.bashrc in everyone’s home directory.
Check in /etc/skel/.bashrc to see if this has been set as a global
default for new accounts?
If a nefarious gem is suspected of making this change, then he can
probably find it using a variant of
grep -R bashrc /usr/lib/ruby/gems/1.8
assuming it’s still installed. However I hope that a gem author would
not do something so obviously dangerous and tied to a specific
architecture.
Regards,
Brian.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.