Solved

Ruby upgrade to 1.8.6 on CentOS

Posted on 2007-11-30
5
7,096 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
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now