Ruby tk -- how do you get it working?

Hidetoshi NAGAI wrote:

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 think I laid it out pretty clearly in my posts.

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.

Please don’t ask me about the result of checking,

Probably, I can answer none of your questions.

On Feb 19, 2008, at 7:41 PM, 7stud – wrote:

manifest or an uninstaller.
After the installer launches, select File>Show Files from the menu
bar. Or just hit cmd-I.

Regards, Morton

Morton G. wrote:

On Feb 19, 2008, at 7:41 PM, 7stud – wrote:

manifest or an uninstaller.
After the installer launches, select File>Show Files from the menu
bar. Or just hit cmd-I.

Regards, Morton

Ok, I did that, and I would estimate that there are around 500-1500
files listed. Here are the first few:

.
./usr
./usr/local
./usr/local/bin
./usr/local/bin/erb
./usr/local/bin/gem
./usr/local/bin/gem_mirror
./usr/local/bin/gem_server
./usr/local/bin/gemlock
./usr/local/bin/gemri
./usr/local/bin/gemwhich
./usr/local/bin/gpgen
./usr/local/bin/index_gem_repository.rb
./usr/local/bin/irb
./usr/local/bin/mongrel_rails
./usr/local/bin/ragel
./usr/local/bin/rake
./usr/local/bin/rdoc
./usr/local/bin/ri
./usr/local/bin/rlgen-cd
./usr/local/bin/rlgen-dot
./usr/local/bin/rlgen-java
./usr/local/bin/rlgen-ruby

  1. I can’t go through all those and delete them by hand.

  2. 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.

7stud – wrote:

  1. I can’t go through all those and delete them by hand.

  2. 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.

John J. wrote:

On Feb 19, 2008, at 9:01 AM, 7stud – wrote:

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.

On Feb 20, 2008, at 1:59 AM, 7stud – wrote:

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

  1. I can’t go through all those and delete them by hand.

  2. 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.

  1. 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.

  2. 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.

Regards, Morton

On Feb 20, 2008, at 8:52 AM, Leslie V. wrote:

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

These should work on Linux under bash. OSX uses tcsh I think:
An A-Z Index of the Apple macOS command line - SS64 Command line reference

…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.

On Feb 20, 2008 8:59 AM, 7stud – [email protected] wrote:

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

  1. 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.

Les

7stud – wrote:

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…

Cheers,
Tim

John J. wrote:

On Feb 20, 2008, at 8:52 AM, Leslie V. wrote:

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

These should work on Linux under bash. OSX uses tcsh I think:
An A-Z Index of the Apple macOS command line - SS64 Command line reference

…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.

Tim F. wrote:

7stud – wrote:

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…

Ok, thanks.

7stud – wrote:

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…

Cheers,
Tim

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…

Let me know if you need any help getting cleaned up or set up with
MacPorts…

Cheers,
Tim

7stud – wrote:

I can’t find the boms directory:

I found this though:

/Library/Receipts/Ruby O.-Click Installer for OSX Tiger.pkg/Contents$
ls -al

total 320
drwxrwxr-x 6 root admin 204 Jan 26 23:48 .
drwxrwxr-x 3 root admin 102 Jan 26 23:48 …
-rwxrwxr-x 1 root admin 151947 Jul 8 2007 Archive.bom
-rw-rw-r-- 1 root admin 2211 Jan 26 23:48 Info.plist
-rw-rw-r-- 1 root admin 8 Jul 8 2007 PkgInfo
drwxrwxr-x 15 root admin 510 Feb 20 04:12 Resources

…but Archive.bom isn’t a directory.

I found the .bom file here:

/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

Tim F. wrote:

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…

I can’t find the boms directory:

/Library/Receipts$ ls

2005-06XcodeExtras.pkg
AdditionalEssentials.pkg
AdditionalFonts.pkg
AdditionalSpeechVoices.pkg
AddressBook.pkg
AppleIntermediateCodec.pkg
AsianLanguagesSupport.pkg
Automator.pkg
BSD.pkg
BSDSDK.pkg
BaseSystem.pkg
BluetoothSDK.pkg
Booth.pkg
BrazilianPortuguese.pkg
BrotherPrinterDrivers.pkg
CPU_BBBGames.pkg
CPU_ComicLife.pkg
CPU_Help.pkg
CPU_OfficeTDUS.pkg
CPU_OmniOutliner.pkg
CPU_RegionalBoot.pkg
CanonPrinterDrivers.pkg
Comic Life.pkg
CoreAudioSDK.pkg
Danish.pkg
DevDocumentation.pkg
DevExamples.pkg
DevSDK.pkg
DeveloperTools.pkg
Dutch.pkg
ElectronicsForImagingPrinterDrivers.pkg
EpsonPrinterDrivers.pkg
Essentials.pkg
Finnish.pkg
FireWireSDK.pkg
French.pkg
FrontRow.pkg
FrontRowUpdate1.3.pkg
GarageBand.pkg
GarageBand_304.pkg
GarageBand_DemoSongs_Tiger.pkg
GarageBand_FactoryContent.pkg
GarageBand_Instruments_Tiger.pkg
GarageBand_Loops_Tiger.pkg
GarageBand_MIDI_Tiger.pkg
German.pkg
GimpPrintPrinterDrivers.pkg
HewlettPackardPrinterDrivers.pkg
Italian.pkg
Japanese.pkg
Java.pkg
Java14Documentation.pkg
Java14Tools.pkg
Keynote3.0.2.pkg
Korean.pkg
LexmarkPrinterDrivers.pkg
MacOSX10.3.9.pkg
MacOSX10.4.Universal.pkg
Mail.pkg
MediaFiles.pkg
MigrationAssistant.pkg
Norwegian.pkg
OmniOutliner 3.5 v134.3.pkg
OpenGLSDK.pkg
OxfordDictionaries.pkg
PIL-platlib-1.1.5-py2.4-macosx10.4.pkg
PIL-scripts-1.1.5-py2.4-macosx10.4.pkg
Pages2.0.2.pkg
PythonApplications-2.4.pkg
PythonDocumentation-2.4.pkg
PythonFramework-2.4.pkg
PythonProfileChanges-2.4.pkg
PythonSystemFixes-2.4.pkg
PythonUnixTools-2.4.pkg
QuickTime713.pkg
QuickTimeSDK.pkg
RicohPrinterDrivers.pkg
Ruby O.-Click Installer for OSX Tiger.pkg
Russian.pkg
Safari.pkg
SimplifiedChinese.pkg
Spanish.pkg
Swedish.pkg
TraditionalChinese.pkg
WebKitSDK.pkg
X11SDK.pkg
X11User.pkg
XeroxPrinterDrivers.pkg
gcc3.3.pkg
gcc4.0.pkg
iCal.pkg
iChat.pkg
iDVD.pkg
iDVDThemes_Tiger.pkg
iDVD_603.pkg
iLifeSoundEffects_Loops.pkg
iMacFirmwareUpdate.pkg
iMovie.pkg
iMovieThemes_Tiger.pkg
iMovie_603.pkg
iPhoto.pkg
iPhotoContent.pkg
iPhoto_605.pkg
iTunes.pkg
iTunesX.pkg
iWeb_112.pkg
iWeb_App.pkg
iWeb_Temp_de.pkg
iWeb_Temp_en.pkg
iWeb_Temp_fr.pkg
iWeb_Temp_ja.pkg
iWeb_Temp_other.pkg
iWork Trial.pkg

I found this though:

/Library/Receipts/Ruby O.-Click Installer for OSX Tiger.pkg/Contents$
ls -al

total 320
drwxrwxr-x 6 root admin 204 Jan 26 23:48 .
drwxrwxr-x 3 root admin 102 Jan 26 23:48 …
-rwxrwxr-x 1 root admin 151947 Jul 8 2007 Archive.bom
-rw-rw-r-- 1 root admin 2211 Jan 26 23:48 Info.plist
-rw-rw-r-- 1 root admin 8 Jul 8 2007 PkgInfo
drwxrwxr-x 15 root admin 510 Feb 20 04:12 Resources

…but Archive.bom isn’t a directory.

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.

On Feb 29, 2008, at 7:02 PM, Tim F. wrote:

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.

  1. Open the installer package in the Receipts folder.
  2. Cmd-I to get the bill-of-material window.
  3. Click on the window title.
  4. Cmd-A to select the whole file list
  5. Cmd-C to copy it to the clipboard.

You can then paste the list into your favorite text editor and save it.

Regards, Morton

7stud – wrote:

7stud – wrote:

I can’t find the boms directory:

I found this though:

/Library/Receipts/Ruby O.-Click Installer for OSX Tiger.pkg/Contents$
ls -al

total 320
drwxrwxr-x 6 root admin 204 Jan 26 23:48 .
drwxrwxr-x 3 root admin 102 Jan 26 23:48 …
-rwxrwxr-x 1 root admin 151947 Jul 8 2007 Archive.bom
-rw-rw-r-- 1 root admin 2211 Jan 26 23:48 Info.plist
-rw-rw-r-- 1 root admin 8 Jul 8 2007 PkgInfo
drwxrwxr-x 15 root admin 510 Feb 20 04:12 Resources

…but Archive.bom isn’t a directory.

I found the .bom file here:

/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. :slight_smile:

Cheers,
Tim

Morton G. wrote:

On Feb 29, 2008, at 7:02 PM, Tim F. wrote:

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.

  1. Open the installer package in the Receipts folder.
  2. Cmd-I to get the bill-of-material window.
  3. Click on the window title.
  4. Cmd-A to select the whole file list
  5. 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.

7stud – wrote:

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… :slight_smile:

Anyway, glad you got everything sorted out!

Cheers,
Tim