From: 7stud – [email protected]
Subject: Re: ruby tk – how do you get it working?
Date: Mon, 18 Feb 2008 19:04:31 +0900
Message-ID: [email protected]
I recently upgraded to Ruby 1.8.6. Ruby tk used to work for me, now it
doesn’t.
How did you upgrade your Ruby?
I found Japanese document of “installation with MacPorts”.
On the document, “+mactk” variant is used.
Although I don’t understand package system of MacOS X,
checking variants of current ruby ports may help you.
I can’t go through all those and delete them by hand.
That leading . confuses me. That doesn’t seem like in can be the
current directory. The current directory is the Receipts directory, and
it has no sub directories.
I can’t go through all those and delete them by hand.
That leading . confuses me. That doesn’t seem like in can be the
current directory. The current directory is the Receipts directory, and
it has no sub directories.
…at least visible in Finder. I checked, though, and each file in
/Library/Receipts is a directory.
The one click installer is fine. It is stripped down a bit, but
everything is in standard locations in /usr/local/
This includes /usr/local/bin and /usr/local/lib/
Basically, it’s very similar to the Hivelogic installation. You can
either, install over it (use the Hivelogic tutorial, please) OR
simply rm -rf the directories for what got installed.
It uses an OS X installer, so it should have an item in ~/Library/
Receipts/ OR in /Library/Receipts
launching that item will relaunch the installer. It will allow you to
get a manifest of installation items and some installers have an
uninstaller.
There is a file in /Library/Receipts called:
Ruby O.-Click Installer for OSX Tiger.pkg
However, when I click on that file, it launches the installer. I don’t
see how to get a manifest, and there is no uninstaller listed. I
progressed through the steps until I got to the last step where you are
supposed to click ‘install’, and there was nothing mentioned about a
manifest or an uninstaller.
files listed. Here are the first few:
./usr/local/bin/gemri
./usr/local/bin/rlgen-dot
./usr/local/bin/rlgen-java
./usr/local/bin/rlgen-ruby
I can’t go through all those and delete them by hand.
That leading . confuses me. That doesn’t seem like in can be the
current directory. The current directory is the Receipts
directory, and
it has no sub directories.
Ruby is, among other things, a first-class scripting language. Use
your Ruby skills. Write a script to delete the files on the install
manifest if that’s what you are set on doing.
The dot refers to current directory when the installer ran. In
this case, you can infer from the manifest that . == /, so you can
ignore the dot.
Ok, I did that, and I would estimate that there are around 500-1500
./usr/local/bin/gemlock
./usr/local/bin/rlgen-cd
it ran (so “.” refers to “/”).
for file in cat /receipts/filelist.txt; do rm $file; done
…so it looks the same but I haven’t tested on the macbook.
Les
No. OS X uses Bash as default shell.
It used to use tcsh before 10.4
it’s been Bash for several years…
At this point, I’m going to recommend the OP get a book such as UNIX
in a Nutshell from Oreilly.
It’s a great reference to keep around.
If new to *nix get Learning Unix for Mac OS X Tiger (since that’s
apparently the version you’ve got)
I’m not trying to say RTFM, but if you want to get farther with Ruby
(or Perl, Python, PHP, etc…) these books will help you get up to
speed on the unix things you should learn.
You’ll feel a lot more comfortable with what you’re doing, I promise.
Regardless, definitely go for the Hivelogic install, building it
yourself gives you some practice and experience with command line
tools. Nothing to fear. If you hose your system, reinstall. If you
don’t already, do backups.
files listed. Here are the first few:
./usr/local/bin/gemri
./usr/local/bin/rlgen-dot
./usr/local/bin/rlgen-java
./usr/local/bin/rlgen-ruby
I can’t go through all those and delete them by hand.
You could search the drive for “rlgen-ruby”. If it is only in
/usr/local/bin,
you have it on good authority that the installed was in “/” when
it ran (so “.” refers to “/”).
You should then be able to:
cd /
for file in cat /receipts/filelist.txt; do ls -la $file; done
…then if you are happy with that list of file, you can do the more
dangerous:
cd /
for file in cat /receipts/filelist.txt; do rm $file; done
These should work on Linux under bash. OSX uses tcsh I think:
…so it looks the same but I haven’t tested on the macbook.
I think it’s really misleading for the main ruby site to promote a one
click installer for mac, where the one click installer website concludes
its promotional hype by saying, you have nothing to lose by installing
ruby 1.8.6 with the one click installer because its simple to uninstall.
That’s a lie, and I don’t think the main ruby site should promote con
artists.
Uh, I understand your frustrations but, hey, relax a bit, okay? I
wouldn’t say it was a lie - they just made assumptions about whether you
would have other software installed under /usr/local … As a Mac user
I’m sure you know that most mac installs do not uninstall
automatically… but they do uninstall easily by deleting the app or
folder, which I suppose was what they were saying…
If you’d like help with a script to clean up the one-click installer
just say the word and I’ll be glad to help… If you’d email me a list
of files that the installer installed I’ll send you a script to safely
clean them up…
Anyway, going forward, I’d suggest you use MacPorts to install and
maintain a “non-Apple” version of Ruby - the Ruby port maintainer is
great about keeping it up to date with the latest patch level and you
can choose between version with and without tk… There are even a few
gui tools to manage installed ports if you prefer that kind of thing…
Ok, I did that, and I would estimate that there are around 500-1500
./usr/local/bin/gemlock
./usr/local/bin/rlgen-cd
it ran (so “.” refers to “/”).
for file in cat /receipts/filelist.txt; do rm $file; done
…so it looks the same but I haven’t tested on the macbook.
Les
No. OS X uses Bash as default shell.
It used to use tcsh before 10.4
it’s been Bash for several years…
At this point, I’m going to recommend the OP get a book such as UNIX
in a Nutshell from Oreilly.
It’s a great reference to keep around.
If new to *nix get Learning Unix for Mac OS X Tiger (since that’s
apparently the version you’ve got)
I’m not trying to say RTFM, but if you want to get farther with Ruby
(or Perl, Python, PHP, etc…) these books will help you get up to
speed on the unix things you should learn.
You’ll feel a lot more comfortable with what you’re doing, I promise.
Regardless, definitely go for the Hivelogic install, building it
yourself gives you some practice and experience with command line
tools. Nothing to fear. If you hose your system, reinstall. If you
don’t already, do backups.
I think it’s really misleading for the main ruby site to promote a one
click installer for mac, where the one click installer website concludes
its promotional hype by saying, you have nothing to lose by installing
ruby 1.8.6 with the one click installer because its simple to uninstall.
That’s a lie, and I don’t think the main ruby site should promote con
artists.
I think it’s really misleading for the main ruby site to promote a one
click installer for mac, where the one click installer website concludes
its promotional hype by saying, you have nothing to lose by installing
ruby 1.8.6 with the one click installer because its simple to uninstall.
That’s a lie, and I don’t think the main ruby site should promote con
artists.
Uh, I understand your frustrations but, hey, relax a bit, okay? I
wouldn’t say it was a lie - they just made assumptions about whether you
would have other software installed under /usr/local …
So some developer assumed that /usr/local would be empty except for
their install? Heck why didn’t they just say, “Our install is easy to
uninstall: delete your hard drive and it’s gone. What could be
simpler?”
As a Mac user
I’m sure you know that most mac installs do not uninstall
automatically… but they do uninstall easily by deleting the app or
folder, which I suppose was what they were saying…
Their app didn’t create a folder–it installed files all over the place
If you’d like help with a script to clean up the one-click installer
just say the word and I’ll be glad to help… If you’d email me a list
of files that the installer installed I’ll send you a script to safely
clean them up…
I should be able to manage a script like that on my own. Will deleting
anything under usr/local affect the operation of the pre-installed ruby?
After I delete all the files will the pre-installed ruby automatically
work, or is there some link somewhere that I have to change?
Anyway, going forward, I’d suggest you use MacPorts to install and
maintain a “non-Apple” version of Ruby - the Ruby port maintainer is
great about keeping it up to date with the latest patch level and you
can choose between version with and without tk… There are even a few
gui tools to manage installed ports if you prefer that kind of thing…
So some developer assumed that /usr/local would be empty except for
their install? Heck why didn’t they just say, “Our install is easy to
uninstall: delete your hard drive and it’s gone. What could be
simpler?”
Well, that would definitely qualify as an easy uninstall ;-0 Of course
it wouldn’t leave you with a usable system but that is another issue…
hehe
Their app didn’t create a folder–it installed files all over the place
Actually, it may have created that /usr/local hierarchy unless you
have installed other stuff there yourself… Did you? If not then it
should be safe to just delete the stuff under /usr/local, although
writing a script to delete from the installer bom would be the best
choice, in my opinion…
Just FYI, you can extract a list of files from a .bom file with the
following command: lsbom -s
I should be able to manage a script like that on my own. Will deleting
anything under usr/local affect the operation of the pre-installed ruby?
After I delete all the files will the pre-installed ruby automatically
work, or is there some link somewhere that I have to change?
No - all of the bundled stuff is under /usr/bin, etc (/usr/local is
typically reserved for user-installed stuff) so it won’t affect the
apple-supplied ruby…
Anyway, going forward, I’d suggest you use MacPorts to install and
maintain a “non-Apple” version of Ruby - the Ruby port maintainer is
great about keeping it up to date with the latest patch level and you
can choose between version with and without tk… There are even a few
gui tools to manage installed ports if you prefer that kind of thing…
Ok, thanks.
One thing to note: if you plan to upgrade to Leopard then it wouldn’t
really be needed, as the latest versions of ruby (1.8.6-p111) and
rubygems (1.0.1) are included in the 10.5.2 update and, as long as you
install the developer tools, then Tk will work out of the box…
Just FYI, you can extract a list of files from a .bom file with the
following command: lsbom -s
Oh, one other thing that might not be immediately obvious… the bom
file would be located under /Library/Receipts/boms … in this case I
think it would be prefixed with something like
“com.parasew.and.5uper.net.rubyosx” since that seems to be the package
bundle identifier…
Also, not to be overly pedantic, but after some looking I don’t think
that the one-click installer for the Mac is in any way officially
endorsed by the ruby developers… If you look at Download Ruby it is not listed and they suggest
either Locomotive as a quick way to set up Rails development or MacPorts
(or Fink, another package management option similar to MacPorts) for the
Mac…
Let me know if you need any help getting cleaned up or set up with
MacPorts…
Their app didn’t create a folder–it installed files all over the place
Actually, it may have created that /usr/local hierarchy unless you
have installed other stuff there yourself… Did you?
Yes.
Tim F. wrote:
Just FYI, you can extract a list of files from a .bom file with the
following command: lsbom -s
Oh, one other thing that might not be immediately obvious… the bom
file would be located under /Library/Receipts/boms … in this case I
think it would be prefixed with something like
“com.parasew.and.5uper.net.rubyosx” since that seems to be the package
bundle identifier…
Also, not to be overly pedantic, but after some looking I don’t think
that the one-click installer for the Mac is in any way officially
endorsed by the ruby developers… If you look at Download Ruby it is not listed and they suggest
either Locomotive as a quick way to set up Rails development or MacPorts
(or Fink, another package management option similar to MacPorts) for the
Mac…
I sent an email to the contact listed on the main ruby website detailing
my problems, and they removed the link to the Mac one click
installer–which I think was justified.
/Library/Receipts/Ruby O.-Click Installer for OSX
Tiger.pkg/Contents/Resources$ ls
Archive.sizes
Description.plist
IFRequirement.strings
License.rtf
ReadMe.rtf
Ruby O.-Click Installer for OSX Tiger.bom
Ruby O.-Click Installer for OSX Tiger.info
Ruby O.-Click Installer for OSX Tiger.post_install
Ruby O.-Click Installer for OSX Tiger.sizes
Welcome.rtf
background.jpg
package_version
postinstall
Ok … The boms directory I mentioned may be a Leopard thing… Now that
you found that file, you should be able to do:
lsbom -s “/Library/Receipts/Ruby O.-Click Installer for OSX
Tiger.pkg/Contents/Resources/Ruby O.-Click Installer for OSX Tiger.bom”
filelist.txt
to get a list of file to delete… and then read that into a shell
script or whatever to delete the files and clean up any empty
directories once that is done.
Glad to hear the ruby guys were responsive to your complaints.
script or whatever to delete the files and clean up any empty
directories once that is done.
The following may be easier – at least I think it is.
Open the installer package in the Receipts folder.
Cmd-I to get the bill-of-material window.
Click on the window title.
Cmd-A to select the whole file list
Cmd-C to copy it to the clipboard.
You can then paste the list into your favorite text editor and save it.
Regards, Morton
Thanks. I used your tip to copy the file names to a file in the current
directory. You don’t need to click on the window title, though–you can
click anywhere on the window and then hit A to select all the
file names.
In case anyone else would like to use it, the following is what I used
to uninstall all the files installed by the mac one click installer.
Look how easy it was!
One small point I meant to bring up earlier - when I’ve written scripts
like this in the past, I always have the script move the files to a
temporary location rather than deleting them directly. That way I can
inspect everything and delete them by hand if everything checks out
ok…
Maybe that’s overly paranoid but having a script delete something
important by mistake really sucks…