Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can't install tk #21

Closed
0xNinjaCyclone opened this issue Oct 6, 2020 · 3 comments
Closed

i can't install tk #21

0xNinjaCyclone opened this issue Oct 6, 2020 · 3 comments

Comments

@0xNinjaCyclone
Copy link

~# gem install tk
Building native extensions. This could take a while...
ERROR: Error installing tk:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/tk-0.2.0/ext/tk

/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201007-7660-1i5ky4m.rb extconf.rb
check functions.checking for ruby_native_thread_p() in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for rb_safe_level() in ruby.h... yes
checking for rb_hash_lookup() in ruby.h... yes
checking for rb_proc_new() in ruby.h... yes
checking for rb_obj_untrust() in ruby.h... yes
checking for rb_obj_taint() in ruby.h... yes
checking for rb_set_safe_level_force() in ruby.h... yes
checking for rb_sourcefile() in ruby.h... yes
checking for rb_thread_alive_p() in ruby.h... no
checking for rb_thread_check_trap_pending() in ruby.h... yes
checking for ruby_enc_find_basename() in ruby.h... yes
check libraries.checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for dlopen() in -ldl... yes
checking for log() in -lm... yes
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh.
WARNING: found "/usr/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.

WARNING: found "/usr/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.

WARNING: found "/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.

WARNING: found "/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.

Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).
checking for XOpenDisplay() in -lX11... yes
Search tcl.h
checking for tcl.h... no
Search tk.h
checking for tk.h... no
Search Tcl library.........*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
--enable-shared
--with-tk-old-extconf
--without-tk-old-extconf
--with-tk-old-extconf
--without-tk-old-extconf
--with-ActiveTcl
--without-ActiveTcl
--with-tk-shlib-search-path
--without-tk-shlib-search-path
--with-tcltkversion
--without-tcltkversion
--with-tcl-build-dir
--without-tcl-build-dir
--with-tk-build-dir
--without-tk-build-dir
--with-tcl-config
--without-tcl-config
--with-tk-config
--without-tk-config
--with-tclConfig-dir
--without-tclConfig-dir
--with-tkConfig-dir
--without-tkConfig-dir
--with-tclConfig-file
--without-tclConfig-file
--with-tkConfig-file
--without-tkConfig-file
--with-tcllib
--without-tcllib
--with-tklib
--without-tklib
--with-tcl-dir
--without-tcl-dir
--with-tk-dir
--without-tk-dir
--with-tcl-include
--without-tcl-include
--with-tk-include
--without-tk-include
--with-tcl-lib
--without-tcl-lib
--with-tk-lib
--without-tk-lib
--with-tcltk-framework
--without-tcltk-framework
--with-tcl-framework-dir
--without-tcl-framework-dir
--with-tk-framework-dir
--without-tk-framework-dir
--with-tcl-framework-header
--without-tcl-framework-header
--with-tk-framework-header
--without-tk-framework-header
--with-X11
--without-X11
--with-X11-dir
--without-X11-dir
--with-X11-include
--without-X11-include
--with-X11-lib
--without-X11-lib
--enable-tcltk-stubs
--disable-tcltk-stubs
--enable-tcl-h-ver-check
--disable-tcl-h-ver-check
--enable-tk-h-ver-check
--disable-tk-h-ver-check
--enable-mac-tcltk-framework
--disable-mac-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--enable-pthread
--disable-pthread
--enable-tcl-thread
--disable-tcl-thread
--enable-space-on-tk-libpath
--disable-space-on-tk-libpath
--with-nsl-dir
--without-nsl-dir
--with-nsl-include
--without-nsl-include=${nsl-dir}/include
--with-nsl-lib
--without-nsl-lib=${nsl-dir}/lib
--with-nsllib
--without-nsllib
--with-socket-dir
--without-socket-dir
--with-socket-include
--without-socket-include=${socket-dir}/include
--with-socket-lib
--without-socket-lib=${socket-dir}/lib
--with-socketlib
--without-socketlib
--with-dl-dir
--without-dl-dir
--with-dl-include
--without-dl-include=${dl-dir}/include
--with-dl-lib
--without-dl-lib=${dl-dir}/lib
--with-dllib
--without-dllib
--with-m-dir
--without-m-dir
--with-m-include
--without-m-include=${m-dir}/include
--with-m-lib
--without-m-lib=${m-dir}/lib
--with-mlib
--without-mlib
--with-tcl-build-dir
--without-tcl-build-dir
--with-tk-build-dir
--without-tk-build-dir
--with-tcltkversion
--without-tcltkversion
--with-ActiveTcl
--without-ActiveTcl
--enable-space-on-tk-libpath
--disable-space-on-tk-libpath
--enable-tcltk-stubs
--disable-tcltk-stubs
--with-tcltk-stubs
--without-tcltk-stubs
--with-tcl-dir
--without-tcl-dir
--with-tcl-include
--without-tcl-include=${tcl-dir}/include
--with-tcl-lib
--without-tcl-lib=${tcl-dir}/lib
--with-tk-dir
--without-tk-dir
--with-tk-include
--without-tk-include=${tk-dir}/include
--with-tk-lib
--without-tk-lib=${tk-dir}/lib
--with-tclConfig-file
--without-tclConfig-file
--with-tkConfig-file
--without-tkConfig-file
--with-tclConfig-dir
--without-tclConfig-dir
--with-tkConfig-dir
--without-tkConfig-dir
--with-tcl-framework-header
--without-tcl-framework-header
--with-tk-framework-header
--without-tk-framework-header
--with-tcl-framework-dir
--without-tcl-framework-dir
--with-tk-framework-dir
--without-tk-framework-dir
--with-tcltk-framework
--without-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--with-tcltk-framework
--without-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--enable-mac-tcltk-framework
--disable-mac-tcltk-framework
--with-tk-shlib-search-path
--without-tk-shlib-search-path
--with-tklib
--without-tklib
--with-tcllib
--without-tcllib
--with-X11
--without-X11
--with-X11-dir
--without-X11-dir
--with-X11-include
--without-X11-include=${X11-dir}/include
--with-X11-lib
--without-X11-lib=${X11-dir}/lib
--with-X11-lib
--without-X11-lib
--with-X11lib
--without-X11lib
--enable-tcl-h-ver-check
--disable-tcl-h-ver-check
--enable-tk-h-ver-check
--disable-tk-h-ver-check

Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.

Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk.
If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib).
At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4.

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/tk-0.2.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.7.0/gems/tk-0.2.0 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/tk-0.2.0/gem_make.out

@jeremyevans
Copy link
Contributor

You probably need the appropriate configuration options passed when installing the gem. What those options should be depend on your environment. For example, on OpenBSD, it is

gem install tk -- \
  --with-tcl-include=/usr/local/include/tcl8.5 \
  --with-tk-include=/usr/local/include/tk8.5 \
  --with-tcllib=tcl85 \
  --with-tklib=tk85 \
  --with-X11-dir=/usr/X11R6

Without knowing your environment, I'm not sure what options are appropriate for you.

@jeremyevans
Copy link
Contributor

I'm going to close this now. Please try using the appropriate configure options for your environment. If you aren't sure what the options are, please include information on where the tcl/tk headers and shared libraries are installed, as well as their names.

@Nakilon
Copy link

Nakilon commented May 28, 2021

Note: brew install tk would install 8.6 but you want 8.5 according to this gem notes.
To get 8.5 you should go to https://platform.activestate.com/fuckyouuu/ActiveTcl-8.5/distributions and register under some fake email (you don't want to trust this company because if you try to log in as Github they'll ask access to private repos -- another reason would be that it's a known issue in Github Auth API that they don't fix for years already but anyway).
After that the gem install tk completes with no issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants