?
Solved

Ruby upgrade to 1.8.6 on CentOS

Posted on 2007-11-30
5
Medium Priority
?
7,162 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
4 Comments
 
LVL 24

Accepted Solution

by:
fridom earned 1000 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 35

Assisted Solution

by:Duncan Roe
Duncan Roe earned 1000 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 35

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

807 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