Solved

Ruby upgrade to 1.8.6 on CentOS

Posted on 2007-11-30
5
7,124 Views
Last Modified: 2013-12-12
I have been running Ruby on a CentOS vps for a while with no problems.  I have been running 1.8.4, which was installed using Yum.  I want to upgrade to 1.8.6, but Yum can't seem to find this version, so I compiled and installed it.  I removed the old version from Yum using "yum remove ruby".  The new version lives in /usr/local/bin/, but every time I try to access it (say I type "ruby -v"), it says "-bash: /usr/bin/ruby: no such file or directory".  /usr/local/bin is in my path, so shouldn't it be able to find it?  Any help would be appreciated.
0
Comment
Question by:mrose2n
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
fridom earned 250 total points
ID: 20390551
That is  a problem of the first line in the ruby scripts, It will look like this:
#!/usr/bin/ruby

And ruby is not there any longer.

Solution:
1) if you have env and are sure that ruby is in your path write the line
#!/usr/bin/env ruby

2) make symbolic link from /usr/local/bin/ruby to /usr/bin/ruby
ln -s /usr/local/ruby /usr/bin/ruby

3) change the first line to
#!/usr/local/bin/ruby

Regards
Friedrich
0
 
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 250 total points
ID: 20392420
I imagine your scripts will suffer from the problem outlined by fridom.
But ruby itself?? Try these:

file $(type -p ruby)
type -a ruby
file /usr/bin/ruby
file /usr/local/bin/ruby

Do file commands on any other likely candidates. If it turns out that the executable you find *is* an ELF program and not a script, check what is the loader in it, it will be something like /lib/ld-linux.so.2. If you "less" the executable, you'll see it as clear text among all the reverse-video binary characters.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 20392692
You may just have to type "hash -r", to remove bash's remembrance of where ruby used to be. In that case, "type ruby" will show something like "ruby is hashed: /usr/bin/ruby"
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20632870
Forced accept.

Computer101
EE Admin
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Let’s list some of the technologies that enable smooth teleworking. 
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question