Solved

Ruby upgrade to 1.8.6 on CentOS

Posted on 2007-11-30
5
7,081 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
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
fridom earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Forced accept.

Computer101
EE Admin
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SAP PM 5 84
Lite dgn, dwg free viewer 1 78
Team Foundation Server 8 42
Tools to Output documents from DB based on selections 8 84
I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
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.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now