Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Ruby upgrade to 1.8.6 on CentOS

Posted on 2007-11-30
5
Medium Priority
?
7,154 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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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