Mac OS X Tiger comes with Tk?

Discussion in 'Ruby' started by SpringFlowers AutumnMoon, Oct 14, 2007.

  1. I thought it is said that Mac OS X Tiger comes with Tk?

    when i do ruby

    require 'tk'

    it gives the following

    dyld: NSLinkModule() error
    dyld: Library not loaded: /usr/X11R6/lib/libX11.6.dylib
    Referenced from: /usr/lib/ruby/1.8/powerpc-darwin8.0/tcltklib.bundle
    Reason: image not found
    Trace/BPT trap
     
    SpringFlowers AutumnMoon, Oct 14, 2007
    #1
    1. Advertisements

  2. Looks like you didn't install X from the dev tools. I'd try that, it
    makes sense that you would need it.

    Ben
     
    Ben Bleything, Oct 14, 2007
    #2
    1. Advertisements

  3. is that X11 (X window)? how would that be installed (from dev tools)?

    thanks.
     
    SpringFlowers AutumnMoon, Oct 14, 2007
    #3
  4. SpringFlowers AutumnMoon

    Andreas S. Guest

    You can find it on your Tiger DVD or download it from Apple. But I don't
    understand why TK even depends on X, it doesn't use the X server.
     
    Andreas S., Oct 14, 2007
    #4
  5. actually, i found those files in

    /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib

    so I tried to use

    ruby -I /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib test.rb

    and it won't work...
    and then I set the PATH in bash to the following and it won't work
    either:

    PATH=/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/bin:/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib:/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6:/bin:/sbin:/usr/bin:/usr/sbin:.
     
    SpringFlowers AutumnMoon, Oct 14, 2007
    #5
  6. Yes, it's X11. It's in the Dev Tools image that you download from
    Apple, or installed as part of your OS installation.

    Ben
     
    Ben Bleything, Oct 14, 2007
    #6
  7. SpringFlowers AutumnMoon

    John Joyce Guest

    Many libs in X11 can be used by software without using the X server
    itself.
     
    John Joyce, Oct 14, 2007
    #7
  8. So either I have to find my original Mac OS X DVD, or I can download it
    from the net....

    is it this page?

    http://developer.apple.com/opensource/tools/runningx11.html

    when i click

    download the X11User.pkg

    it says the page can't be found
     
    SpringFlowers AutumnMoon, Oct 15, 2007
    #8
  9. By the way I also installed ActiveTcl on the Mac, can't I just start
    using Tk? Wow, so big a procedure before being able to use Tk.
     
    SpringFlowers AutumnMoon, Oct 15, 2007
    #9
  10. This thread got me looking into my (rather new) macbooks ruby installation.

    I installed ruby using macports right after getting the machine. I
    don't even have tk.rb to require.

    Looking around at macports, it seems that there are TWO port variants
    for the ruby port related to tk
    one is called just tk, the other mactk.

    I'm not sure but I suspect that the tk variant requires X11, and that
    the mactk variant doesn't.

    I'm still very much an OSX newbie, my last Mac was a ppc which
    couldn't run anything past OS 8.something, and I've been using Linux
    for some time. I'm not clear yet on what's the best way to try to
    rebuild ruby using port to add the mactk variant. Do I need to
    uninstall and reinstall or is there a better way?
     
    Rick DeNatale, Oct 15, 2007
    #10
  11. Just to follow up, I did this:

    $port deactivate ruby
    $port install ruby +mactk

    This made my current ruby install inactive, then installed a new
    version with the mactk option.

    The pickaxe Tk hello world application runs and it is using native OSX widgets.

    A variation on this is probably the trick to get around the X11 dependency.
     
    Rick DeNatale, Oct 15, 2007
    #11
  12. that's weird... my Mac doesn't have "port"
    hm... although i don't like the installation process of Linux, its

    sudo get-apt install ruby

    is quite good...

    when i type

    ruby -v

    it even told me ruby is not available and i could type the "sudo
    get-apt" line above to get it. i wonder if Mac has something like that
    too.
     
    SpringFlowers AutumnMoon, Oct 16, 2007
    #12
  13. SpringFlowers AutumnMoon

    Tim Hunter Guest

    The port command is part of MacPorts, a.k.a. DarwinPorts.

    http://darwinports.com/
     
    Tim Hunter, Oct 16, 2007
    #13
  14. SpringFlowers AutumnMoon

    7stud -- Guest

    How do you 'instal X from the dev tools'?

    On the Mac OS X Install Disc 1, there are these files(among others):

    /Volumes/Mac OS X Install Disc 1/Xcode Tools/Packages/DeveloperTools.pkg

    /Volumes/Mac OS X Install Disc 1/Xcode Tools/Packages/X11SDK.pkg
     
    7stud --, Oct 27, 2007
    #14
  15. SpringFlowers AutumnMoon

    7stud -- Guest

    ...or would it be easiest to reinstall Xcode in its entirety and then
    check a box that says to install X? I went through the setup for the
    Xcode installation before canceling out of it , and under "Software
    Development Kits" there was an entry for "X11 SDK", but it was grayed
    out.
     
    7stud --, Oct 27, 2007
    #15
  16. Honestly, I'm not sure. It's been a long time since I installed the dev
    tools on Tiger and I don't remember all the steps. You could try
    running the X11 sdk installer directly and see if it will let you.
    Otherwise, you could try deleting your /Developer and reinstalling, but
    that's sort of a lame option.

    You might be able to build what you need out of MacPorts as well, but I
    don't know. Sorry.

    Ben
     
    Ben Bleything, Oct 27, 2007
    #16
  17. SpringFlowers AutumnMoon

    7stud -- Guest


    On Install Disc1, I went into the directory Xcode Tools>Packages, and
    then I clicked on the file X11SDK.pkg, and an installation wizard guided
    me through a simple installation, which only required that I enter my
    password. But when I try to run the following program:

    require 'tk'

    I get the same error message as before:

    dyld: NSLinkModule() error
    dyld: Library not loaded: /usr/X11R6/lib/libX11.6.dylib
    Referenced from: /usr/lib/ruby/1.8/universal-darwin8.0/tcltklib.bundle
    Reason: image not found
    Trace/BPT trap
     
    7stud --, Oct 29, 2007
    #17
  18. I think what you are looking for isn't in Xcode Tools. It's in
    Optional Installs.mkpkg under Applications in the Installation Type
    panel.

    Regards, Morton
     
    Morton Goldberg, Oct 29, 2007
    #18
  19. SpringFlowers AutumnMoon

    7stud -- Guest

    My god. You've done it.

    I couldn't figure out what the heck you were referring to because the
    disc1 contents window had six icons in it: one was the Xcode Tools
    directory and none of the other icons was Optional Installs.mpkg. So I
    did a search with Finder, and Finder said that the file Optional
    Installs.mpkg was on disc1. What the?! Then I expanded the disc1
    contents window, and voila! some other icons magically appeared at the
    bottom. I don't think the default for that page should be icon view!

    For future searchers these are the steps:

    1) Slide the "Mac OS X Install Disc1" into your drive. A window that
    says "Mac OS X Install Disc 1" will pop up showing you the contents of
    the disc. Drag the window open as big as you can; or up in the menu
    bar, click on View>as List.

    2) Click on the file:

    Optional Installs.mpkg

    It's not inside a directory, so you shouldn't have to go searching
    through any folders.

    2) A wizard will lead you through the install. When you get to the page
    that says:

    Custom Install on "Macintosh HD(or whatever destination you chose on the
    previous page)"

    ...click on the arrow to the left of Applications to reveal a list of
    choices.

    3) Check X11 and click the Install button.
     
    7stud --, Oct 29, 2007
    #19
  20. SpringFlowers AutumnMoon

    7stud -- Guest

    I am using os x 10.4.7 and ruby 1.8.2.
     
    7stud --, Oct 29, 2007
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.