Generic-user-small johan bjørn 2 posts

Hello I posted this under errata first, but I guess this is better place:

Setup.rb does not work the way it is supposed to on my computer. After I have run setup.rb I’m still not able to call clash-check.rb from an arbitrary folder. I’m on Mac OS X. I don’t seem to have any site_local folder which is unfortunate since it is mentioned repeatedly. Files seem to be installed in /System/Library/Ruby.framework… In Mac OS X Leopard ruby has been framwork’ized could this have something to do with my problems?

This is (most) of the output when I run setup.rb:
<—bin
rm -f InstalledFiles
—> bin
mkdir -p /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/
install clash-check.rb /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/

My loadpath looks like this:
/Library/Ruby/Site/1.8
/Library/Ruby/Site/1.8/powerpc-darwin9.0
/Library/Ruby/Site/1.8/universal-darwin9.0
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin9.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
.

But I guess that I’m not going to be able to run clash-check.rb from an arbitrary folder before /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ is put into my loadpath?

I have tried adding it to my .profile file like this:
export RUBYLIB=”/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/${RUBYLIB:-”“}”
but that the load path still looks the same (after I restart the terminal)

—Johan Bjørn

 
England-small_small Brian Marick 27 posts

Sorry for the delayed reply.

You’re right – the instructions are incomplete for OS X Leopard. When you run setup.rb, it puts the executables in a ruby-specific folder. You have to make symbolic links from /usr/bin to that folder. Like this:

sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/clash-check.rb /usr/bin/clash-check.rb

Once you’ve done that, it works:

$ ruby -S clash-check.rb csv
DANGER: A library named csv already exists.

Note that you don’t need to use the -S on Unix systems (like MacOSX). You can run the script directly:

$ clash-check.rb csv
DANGER: A library named csv already exists.

If you don’t like messing with /usr/bin, you can put the Ruby-specific executable directory into your $PATH (not RUBYLIB). Like this:

export PATH=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin:$PATH

That’s probably wisest – less chance later OSX upgrades will erase the symbolic link.

 
Generic-user-small johan bjørn 2 posts

Thanks Brian

I chose solution number two, as you suggested, and that worked :)

Best Regards, Johan BJørn

3 posts, 2 voices