Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing tk/tcl on an existing ruby 2.2 installation in ubuntu 14.04

I saw some fix for previous versions of ruby, unfortunately, it doesn't work anymore for 2.2... Is there a way to add it up to my existing installation, or should I do a reinstall so I can configure ruby to include tk/tcl? Anyways, I'm using rbenv as my version manager.

like image 556
Jason Adrian Bargas Avatar asked Oct 20 '22 09:10

Jason Adrian Bargas


1 Answers

Had the same issue as I think you have(/had?). I'm running ruby 2.2 on ubuntu 14.04 installed using rbenv. When I tried

require 'tk'

I got:

cannot load such file -- tk

After a lot of fidgeting around I finally made it work by downloading ActiveTCL from http://www.activestate.com/activetcl/downloads (I got version 8.6.4), unpacked it and installed it using

sudo ./install.sh

I also added the bin folder of ActiveTcl to my path (updated my ~/.profile), on my installation it is: /opt/ActiveTcl-8.6/bin/

then uninstalling the ruby version using

rbenv uninstall 2.2.2

And reinstalling it using

rbenv install 2.2.2

After that I can now require tk and not get any error.

like image 132
Klepto Avatar answered Oct 22 '22 08:10

Klepto