Configure Readline with wrong directory. Oops.
July 23, 2007 8:18 PM   Subscribe

Configured Readline with the prefix 'ur/local' on OSX. Then installed Ruby in /usr/local, but with Readline. Would like to put everything in the proper place without damaging anything, so what do I do now?

A history snippet so you can see exactly what I've done:

313 cd /usr/local
314 cd src
315 ls
316 cd readline-5.1
317 clear
318 ls
319 clear
320 ./configure --prefix=/ur/local
321 make
322 sudo make install
323 cd ..
324 ls
325 clear
326 curl -O
327 tar xzvf ruby-1.8.6.tar.gz
328 cd ruby-1.8.6
329 ./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local --enable-shared
330 make
331 sudo make install
332 sudo make install-doc

Following Hivelogic's instructions, I did the above, failing to notice my typo. So now I have a /ur/local directory with what appears to be Readline inside, whilst Ruby resides in /usr/local.

I should mention that everything seems to have worked (Ruby works fine), so this is more to keep everything tidy and in the proper place.

I'm unfamiliar with the intricacies of configure, make etc., but would I be correct in assuming that I can't just take out Readline and reinstall due my invoking it when installing Ruby?

What should I do now to put Readline in /usr/local? Or should I just uninstall/unmake everything and start again (and how should I go about that - specific commands would be extremely helpful, due to my inexperience in this area)?
posted by djgh to Computers & Internet (5 answers total)
Just move readline from /ur/local to /usr/local
posted by bitdamaged at 8:23 PM on July 23, 2007

I'm not quite sure what the process is on OSX, but over in ubuntu/gnu+linux(/politically-correct) land, I'd do the following as the super user:

mv /ur/local/lib/libreadline* /usr/local/lib
rm -rf /ur
rm -ri /ur

Be very careful on that last line, be careful you don't make a mistake in the other way and blow away all of 'usr' instead of 'ur'. Triple check it. In fact, I've actually gone ahead and changed the 'f' argument to an 'i' argument, just so that you will have to check it.
posted by Netzapper at 8:44 PM on July 23, 2007

Response by poster: So there are no dependencies or anything that will be screwed up by my justing moving it?
posted by djgh at 8:48 PM on July 23, 2007

Best answer: FWIW, you already have /usr/lib/libreadline.dylib most likely. You can see where the Ruby binary is linked to with otool:

% otool -L /path/to/ruby

If it's linked to another libreadline, you probably don't even need yours. What I would do, in order of preference, is to use fink for all of this. Failing that for whatever reason, I'd rebuild everything with the correct prefixes. You can remove /ur/local entirely, then anything else you install will either overwrite the old data or install the proper data. It doesn't take too long to do all that, given that you've already done it, so you may as well avoid any potential runpath problems in the future.

But really, 'fink install ruby' is much cleaner. :)
posted by kcm at 9:16 PM on July 23, 2007

yeah, there are dependencies (which you can view with otool, like kcm says) — each executable (and shared library) contains the paths to other shared libraries it depends on. There isn't any particular equivalent to Linux's ldconfig. There are workarounds you could do, but really you should just delete and reinstall readline, and re-configure and -make ruby.
posted by hattifattener at 10:42 PM on July 23, 2007

« Older "Love Removal Machine"'s lyrics with "I'm Your...   |   How do I get public exposure for my invention? Newer »
This thread is closed to new comments.