Sponsored Content
Top Forums UNIX for Dummies Questions & Answers What Makes an App the System Default? Post 302770437 by bakunin on Friday 15th of February 2013 09:51:55 PM
Old 02-15-2013
I notice with satisfaction you still tenaciously learn UNIX despite my efforts to let the subject look boring and hard to grasp - good!
Quote:
Originally Posted by sudon't
Code:
$ sudo gem install scrabble-solver
ERROR:  Error installing scrabble-solver:
	scrabble-solver requires Ruby version >= 1.9.2

$ which ruby
/usr/bin/ruby

$ ls -l /opt/local/bin/ |grep ruby
-rwxr-xr-x   1 root  admin     9024 Feb  6 11:21 ruby1.9
$

Why didn't ruby 1.9 become the default? How does the system determine which app is the default? I used to think it simply accepted the first one it came across in my PATH, but clearly that is not the case.
Code:
$ echo $PATH
/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/X11/bin

To me it looks like the problem is the name: the new ruby in "/opt/local/bin" is not named "ruby", but "ruby1.9". If you issue which ruby1.9 you would probably see this one, but if you search for "ruby", you get the one in "/usr/bin" simply because it is the only "ruby" you have.

Now, why ruby decided to install as "ruby1.9" and not as "ruby" i don' know. I don't know Macs version of UNIX at all, so i can only tell you what is the possible reason for the problem, not how to solve it.

You can, of course, try to solve the problem brute-force:

Rename "/usr/bin/ruby" to something else, say, "/usr/bin/ruby1.8". Then create a softlink:

Code:
ln -s /opt/local/bin/ruby1.9 /usr/bin/ruby

Whenever "ruby" is used, this link is followed and your new executable is used. If this works, i don't know. (There might be libraries or whatever necessary for ruby to work and it will probably not find them in any arbitrary place.) If this is not working, just delete the softlink and move the original ruby back into place:

Code:
rm /usr/bin/ruby
mv /usr/bin/ruby1.8 /usr/bin/ruby

I hope this helps.

bakunin
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Loading App as the System starts

Hi Folks! I am a Mac OS X user, and have written an Applescript application that I would like it to be run before the user logs in. I have tryed leaving the Mac on the "Login Screen", that screen just before you log in typing name and password, and logging using ssh from another Mac on the... (0 Replies)
Discussion started by: fundidor
0 Replies

2. UNIX for Dummies Questions & Answers

chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/.... NOT PERMITTED

After much reflecting I decided that I don't want to have a remote managemente in my computer and I digited in Terminal from the Administrator Account: chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent But the answer is: NOT PERMITTED Why? Is it not... (6 Replies)
Discussion started by: Vera
6 Replies

3. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
DH-MAKE-RUBY(1) 														   DH-MAKE-RUBY(1)

NAME
dh-make-ruby - build Debian source package from Ruby library USAGE
dh-make-ruby [OPTIONS] TARBALL|DIRECTORY DESCRIPTION
dh-make-ruby will create a basic Debian source package from a tarball named TARBALL generated with gem2tgz, or from a DIRECTORY containing Ruby code and metadata in a .gemspec file. OPTIONS
-p PACKAGE, --package PACKAGE Uses PACKAGE as package name. By default, new packages will be named as ruby-$gem, where $gem is the upstream name. If the package is mainly used as a library, then it should use the default. On the other hand, if the packages is mainly used as an application, then you should drop the ruby- prefix by using this option an explicit package u. --ruby-versions VERSIONS Ruby versions to build the package for. This is used to generate the X-Ruby-Versions: field in the source package, that can later be used to tune this value. By default, gem2deb generates a package that works on all known Ruby versions, but it might be necessary to only build the package for Ruby 1.8, for example (using --ruby-versions "ruby1.8"). -h, --help Displays the help -v, --version Displays version information and exits. SEE ALSO
gem2deb(1), dh_ruby(1) COPYRIGHT AND AUTHORS
Copyright (c) 2011, Lucas Nussbaum <lucas@debian.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. 2012-03-06 DH-MAKE-RUBY(1)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy