-1

I need the Gem TK on my Mac with Mojave. I followed a tutorial that worked for a friend, but she can't explain how she did it anymore.

I installed:

  • The CommandLine tool
  • homebrew rbenv and ruby-build
  • Ruby 2.6.2, which is used globally. (ruby -v => 2.6.2)
  • rbenv init into the shell
  • rbenv-doctor

But I can't get any further with:

$ bundle install

Neither using Gemfile:

source 'https://rubygems.org' do
  gem 'tk'
end

nor without it:

$ sudo gem install tk

works. I get:

Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.

I can't find X11 libraries. So I can't make tcltklib.so, which is required by Ruby/Tk. So I installed ActiveTCL and did:

$ sudo gem install tk

When I start the program, the toolkit opens, and my classes are visible, but I can't execute any methods. Everything is black. With my setup in Windwows, my programm runs perfectly.

Do you know why my toolkit doesn't run flawless?

sawa
  • 165,429
  • 45
  • 277
  • 381
borstel
  • 11
  • 1
  • 1

1 Answers1

3

X11 is no longer shipped with macOS [1]. If it is required by one of your libs, then you can try installing XQuartz. This message:

Warning:: cannot find X11 library. tcltklib will not be compiled

means, that X11 is required by tk gem.

ololobus
  • 3,568
  • 2
  • 18
  • 23