Ruby tk -- how do you get it working?

Morton Goldberg wrote:

installer.

Well, if you made a full backup of your start-up drive before you
installed 1.8.6 (and you should have),

You mean my Macintosh HD? I didn't back it up. Are you supposed to
back up a 250G drive every time you install something?

If you don't have a
recent backup, then I can't help you because I have no idea what the
installer you used installed.

The one click installer instructions make it sound like you could just
delete a directory and it would be gone. Now I really think that link
should be removed from the main ruby website. There's no contact info
for the one click installer, so there is no one I can contact about
uninstalling it.

But maybe you are giving up to easily; maybe you shouldn't uninstall.
you might try finding and adding the missing Ruby/Tk library files. I
should think they would be available for download from svn.ruby-
lang.org.

Thanks for your help. I think I'll just give up on ruby tk.

···

On Feb 19, 2008, at 7:05 AM, 7stud -- wrote:

--
Posted via http://www.ruby-forum.com/\.

Yes. At least when you are installing a large package like Ruby 1.8.6. There are products (I use SuperDuper) that make this both quick and easy (because they only update the backup image rather than making a whole new one).

If you have a recent update, you can compare /usr/local/ on your start-up drive to /usr/local/ on your backup drive to see what changed.

Regards, Morton

···

On Feb 19, 2008, at 10:01 AM, 7stud -- wrote:

You mean my Macintosh HD? I didn't back it up. Are you supposed to
back up a 250G drive every time you install something?

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.

···

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

Morton Goldberg wrote:

On Feb 19, 2008, at 7:05 AM, 7stud -- wrote:

installer.

Well, if you made a full backup of your start-up drive before you
installed 1.8.6 (and you should have),

You mean my Macintosh HD? I didn't back it up. Are you supposed to
back up a 250G drive every time you install something?

If you don't have a
recent backup, then I can't help you because I have no idea what the
installer you used installed.

The one click installer instructions make it sound like you could just
delete a directory and it would be gone. Now I really think that link
should be removed from the main ruby website. There's no contact info
for the one click installer, so there is no one I can contact about
uninstalling it.

But maybe you are giving up to easily; maybe you shouldn't uninstall.
you might try finding and adding the missing Ruby/Tk library files. I
should think they would be available for download from svn.ruby-
lang.org.

Thanks for your help. I think I'll just give up on ruby tk.
-- Posted via http://www.ruby-forum.com/\.

John Joyce 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 One-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 19, 2008, at 9:01 AM, 7stud -- wrote:

--
Posted via http://www.ruby-forum.com/\.

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

Regards, Morton

···

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

There is a file in /Library/Receipts called:

Ruby One-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.

Morton Goldberg 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.

···

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

--
Posted via http://www.ruby-forum.com/\.

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.

···

--
Posted via http://www.ruby-forum.com/\.

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

···

On Feb 20, 2008 8:59 AM, 7stud -- <bbxx789_05ss@yahoo.com> wrote:

Morton Goldberg 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.

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 1:59 AM, 7stud -- wrote:

Morton Goldberg 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.

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, at 8:52 AM, Leslie Viljoen wrote:

On Feb 20, 2008 8:59 AM, 7stud -- <bbxx789_05ss@yahoo.com> wrote:

Morton Goldberg 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.

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

John Joyce wrote:

···

On Feb 20, 2008, at 8:52 AM, Leslie Viljoen 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.
--
Posted via http://www.ruby-forum.com/\.

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

···

--
Posted via http://www.ruby-forum.com/\.

Tim Ferrell 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.

···

--
Posted via http://www.ruby-forum.com/\.

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 <bom file>

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

···

--
Posted via http://www.ruby-forum.com/\.

Tim Ferrell wrote:

Just FYI, you can extract a list of files from a .bom file with the
following command: lsbom -s <bom file>

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

···

--
Posted via http://www.ruby-forum.com/\.

Tim Ferrell 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 Ferrell wrote:

Just FYI, you can extract a list of files from a .bom file with the
following command: lsbom -s <bom file>

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

···

--
Posted via http://www.ruby-forum.com/\.

7stud -- wrote:

I can't find the boms directory:

I found this though:

/Library/Receipts/Ruby One-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 One-Click Installer for OSX
Tiger.pkg/Contents/Resources$ ls

Archive.sizes
Description.plist
IFRequirement.strings
License.rtf
ReadMe.rtf
Ruby One-Click Installer for OSX Tiger.bom
Ruby One-Click Installer for OSX Tiger.info
Ruby One-Click Installer for OSX Tiger.post_install
Ruby One-Click Installer for OSX Tiger.sizes
Welcome.rtf
background.jpg
package_version
postinstall

···

--
Posted via http://www.ruby-forum.com/\.

7stud -- wrote:

7stud -- wrote:

I can't find the boms directory:

I found this though:

/Library/Receipts/Ruby One-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 One-Click Installer for OSX
Tiger.pkg/Contents/Resources$ ls

Archive.sizes
Description.plist
IFRequirement.strings
License.rtf
ReadMe.rtf
Ruby One-Click Installer for OSX Tiger.bom
Ruby One-Click Installer for OSX Tiger.info
Ruby One-Click Installer for OSX Tiger.post_install
Ruby One-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 One-Click Installer for OSX
Tiger.pkg/Contents/Resources/Ruby One-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

···

--
Posted via http://www.ruby-forum.com/\.

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

···

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

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 One-Click Installer for OSX
Tiger.pkg/Contents/Resources/Ruby One-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.

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!

The program produces output while running that identifies each file name
as either a dir or a file. If the file name is a dir, it is skipped. If
the file name is a file, it is deleted. For files that are deleted, the
dir containing the file is examined to determine if it is now empty. If
the dir is empty, it is deleted. Here is some sample output:

/users/me/2testing/dir2 is a dir
---Skipping to next file name.
/users/me/2testing/dir2/aaa.txt is a file
---Deleted file: /users/me/2testing/dir2/aaa.txt
examining dir: /users/me/2testing/dir2
---Dir isn't empty.
/users/me/2testing/dir2/test1.txt is a file
---Deleted file: /users/me/2testing/dir2/test1.txt
examining dir: /users/me/2testing/dir2
---Dir isn't empty.
/users/me/2testing/dir2/sub_dir is a dir
---Skipping to next file name.
/users/me/2testing/dir2/sub_dir/bbb.txt is a file
---Deleted file: /users/me/2testing/dir2/sub_dir/bbb.txt
examining dir: /users/me/2testing/dir2/sub_dir
---Dir isn't empty.
/users/me/2testing/dir2/sub_dir/test2.txt is a file
---Deleted file: /users/me/2testing/dir2/sub_dir/test2.txt
examining dir: /users/me/2testing/dir2/sub_dir
---Deleted dir: /users/me/2testing/dir2/sub_dir
examining dir: /users/me/2testing/dir2
---Deleted dir: /users/me/2testing/dir2

The program also writes every file and directory that it deletes to a
file named:

deleted_files_Mac_One_Click_Installer.txt

so that there is a permanent record of what the program did. The output
to the file looks like this:

Deleted Directories:
/users/me/2testing/dir2/sub_dir
/users/me/2testing/dir2

Deleted Files:
/users/me/2testing/dir2/aaa.txt
/users/me/2testing/dir2/test1.txt
/users/me/2testing/dir2/sub_dir/bbb.txt
/users/me/2testing/dir2/sub_dir/test2.txt

Here is the program (I also wrote some comments after the code):

=begin
If you go here:

/Library/Receipts/

and click on:

Ruby One-Click Installer for OSX Tiger.pkg

the installer will launch. If you then click on File>Show Files
in the Apple menubar, you will see a list of the files installed
by the installer. To copy all the file names, click anywhere in
the window and hit <apple>A and <apple>C. You can then paste the
file names into a .txt file by hitting <apple>P.

You can also get that list of files here:

/Library/Receipts/Ruby One-Click Installer for OSX
Tiger.pkg/Contents/Resources$

with this command:

/Library.../Resources$ lsbom -s Ruby\ One-Click\ Installer\ for\ OSX\
Tiger.bom
=end

def get_master_file_and_path_to_remove

  puts
  puts <<STR
To delete the files under the directory /usr/local, you will most
likely need 'root permissions'. Therefore, you need to run this
program using the command:

$ sudo ruby this_program_name.rb
password: <enter your password>

If you didn't run this program using that command, then exit
the program now. Would you like to exit now('y' or 'n'):
STR

  answer = gets.strip
  if ['y', 'Y', 'yes'].include?(answer)
    puts
    puts "Program terminated."
    exit(1)
  end

  puts
  puts <<STR
Enter the path to a file that contains the file names you
want to delete(if the path has spaces in it, escape the
spaces with a '\\'). You will be given the opportunity
to exit the program before any actual deleting takes place:
STR

  #File containing all the file names to delete:
  delete_list = gets.strip

  puts
  puts <<STR
Enter the path that should be removed from the front of
the filenames(or hit return for none):
STR

  remove_path = gets.strip
  if remove_path.length == 0
    remove_path = nil
  end

  #Show examples of new file names:
  samples = []
  count = 0
  fname = nil
  IO.foreach(delete_list) do |line|
    fname = extract_fname(line, remove_path) #extract_fname() defined
below

    if fname
      samples << fname
      count += 1
      break if count > 5
    end
  end

  puts

  #Confirm whether these are the file names that should be deleted:
  puts <<STR
Do the following look like the names of the files you want to
delete(y or n)?\n
STR
  puts samples

  answer = gets.strip
  puts
  if !['y', 'Y', 'yes'].include?(answer)
    puts
    puts "Program terminated."
    exit(1)
  end

  puts <<STR
Are you sure you want to delete all the files? If you answer yes,
then this program will scour your hard drive for all the file names
contained in the file you entered. The program will then delete
those files as well as any directories that become empty as a result
of deleting a file. This program will NOT delete the directory
/usr/local or any higher directories.

The names of all the files and directories that were deleted will
be written to a file called:

'deleted_files_Mac_One_Click_Installer.txt'.

Enter 'y'(for yes) if you want to begin deleting the files now.
Otherwise enter, 'n'(for no) if you want to exit the program:
STR

  answer = gets.strip
  puts
  if !['y', 'Y', 'yes'].include?(answer):
    puts
    puts "Program Terminated"
    exit(1)
  end

  return delete_list, remove_path
end

def extract_fname(line_from_file, path_to_remove=nil)

  #remove any leading and trailing whitespace:
  fname = line_from_file.strip

  if fname.length == 0 #then blank line in file
    return nil

  elsif not path_to_remove
    return fname

  else #then chop the specified path off the start of fname
    if fname == path_to_remove #
      return nil
    end

    len = path_to_remove.length
    if fname[0, len] == path_to_remove #then fname starts with the path
      fname = fname[len..-1] #remove leading path from fname
      return fname

    else #fname doesn't start with the specified path
      raise ArgumentError,
           "Cannot remove path:\n\t%s from file name:\n\t%s" %
            [path_to_remove, fname]
    end
  end
end

def delete_file(file_name)
  #If the file name corresponds to a file, delete the file.
  #If the file name is a dir, take no action.
  #If the file name doesn't correspond to an existing file or dir,
  #raise a RuntimeError.

  if File.directory?(file_name)
    printf("%s is a dir\n", file_name)
    puts "---Skipping to next file name."
    return false
  elsif File.file?(file_name)
    printf("%s is a file\n", file_name)
    File.delete(file_name)
    printf("---Deleted file: %s\n", file_name)
    return true
  else
    raise RuntimeError, "No such file or directory - %s" % file_name
  end
end

def delete_empty_dirs(curr_dir, stop_dir)
  #Check whether the current directory that used to contain
  #the deleted file is empty and therefore should be deleted.
  #as well. If the current diretory is deleted, then recursively
  #check the parent directories to see if they are now
  #empty and need deleting.
  #--stop_dir is the furthest up the file hierarchy
  #that this method will delete empty dirs.

  deleted_dirs = []
  while curr_dir != stop_dir
    printf("examining dir: %s\n", curr_dir)

    files_in_dir = Dir.entries(curr_dir)
    #Empty dirs on a mac contain the dirs ".", ".." and possibly a file
    #called ".DS_Store". A .DS_Store file is created if you ever
    #navigated to the dir using Finder. The .DS_Store file contains view
    #options, icon position info, etc. Ruby will delete a dir if the dir
    #contains only "." and "..", but ruby won't delete a dir if the dir
    #contains the file .DS_Store. Hence the following:
    empty_dir_on_mac = [".", "..", ".DS_Store"]
    extra_files = files_in_dir - empty_dir_on_mac

    if extra_files.length == 0 #then dir needs deleting
      if files_in_dir.include?(".DS_Store")
        full_path = File.join(curr_dir, ".DS_Store")
        File.delete(full_path)
      end

      Dir.delete(curr_dir)
      printf("---Deleted dir: %s\n", curr_dir)
      deleted_dirs << curr_dir

    else
      printf("---Dir isn't empty.\n")
      break #no need to check parent dirs
    end

    #Get parent dir for the next loop to examine:
    curr_dir = File.dirname(curr_dir)
  end

  return deleted_dirs
end

def log_results(files_deleted, dirs_deleted)
  File.open('deleted_files_Mac_One_Click_Installer.txt', 'w') do |file|
    file.puts("Deleted Directories:")
    file.puts(dirs_deleted)

    file.puts

    file.puts("Deleted Files:")
    file.puts(files_deleted)
  end
end

#------MAIN PROGRAM-----------

delete_list, path_to_remove = get_master_file_and_path_to_remove()

deleted_files = []
deleted_dirs = []

IO.foreach(delete_list) do |a_line|

  #Extract a file name from the line:
  fname = extract_fname(a_line, path_to_remove)
  next if !fname

  #If fname is the name of a file, delete it:
  if delete_file(fname)
    deleted_files << fname
  else #then fname is a dir
    next #A dir doesn't become empty unless you delete a file contained
         #therein, so skip the code below which checks for empty dirs.
  end

  #Delete any directories that are now empty as the result
  #of deleting a file:
  top_dir = '/users/autie/2testing' #don't check directories above this
one
  dir_name = File.dirname(fname)
  deleted = delete_empty_dirs(dir_name, top_dir)
  deleted_dirs.concat(deleted)

end

#Write the names of all the deleted files and dirs
#to a file:
log_results(deleted_files, deleted_dirs)

···

===============
**********************

Comments on testing

For testing, I used this hierarchy:
/
--users
-----me
-------2testing
-----------dir2
---------------aaa.txt
---------------test1.txt
---------------sub_dir
-------------------test2.txt
-------------------bbb.txt

This was my list of files to delete:

./users/me/2testing/dir2
./users/me/2testing/dir2/aaa.txt
./users/me/2testing/dir2/test1.txt

./users/me/2testing/dir2/sub_dir
./users/me/2testing/dir2/sub_dir/bbb.txt
./users/me/2testing/dir2/sub_dir/test2.txt

During testing, I used the directory /users/me/2testing as the top
directory in the code (instead of /usr/local). After running the
program and entering the file name with the files to delete and '.' as
the path to remove, I was left with this hierarchy:

/
--me
----2testing

After getting that to work correctly, I changed the top directory in the
code to /usr/local, and then I ran the program for real. When prompted,
I entered a file name containing all the files that the mac one click
installer installed, and I entered '.' as the path to remove.

After the program finished deleting all the files, the pre-installed
ruby, which is version 1.8.2 for me, worked without me doing anything
else, and ruby tk started working again.

--
Posted via http://www.ruby-forum.com/.