RVM Ruby with TK Installation (OSX)

I am trying to install Ruby with TK support.

Using RVM, I did this:

rvm install 1.9.2 -C --enable-shared --enable-pthread 

The installation works fine and I see something called

 .rvm/src/ruby-1.9.2-p320/ext/tk/tcltklib.c 

which i guess is the library i need?

Then i try to run

 require 'tk' 

in irb but get error message

 LoadError: no such file to load -- tk 

Any ideas?

Update: fixed!

If someone is interested in the complete list of steps for upgrading Ruby to 2.0.0 with TK support on OSX, this is what I did:

Install RVM for Ruby -

 \curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby 

Install TK from ActiveTcl - http://www.activestate.com/activetcl

Run

 rvm reinstall 2.0.0 --enable-shared --enable-pthread --with-tk --with-tcl 

Run irb and verify that the TK installation was successful with

 require 'tk' 
+2
source share
2 answers

RVM disables tk / tcl by default (problems with OS X), you need to tell ruby ​​(via rvm) that you want tk / tcl:

 rvm install 1.9.2 --enable-shared --enable-pthread --with-tk --with-tcl 
+7
source

First install ActiveState ActiveTCL from here . Then reinstall Ruby with this command:

 rvm reinstall 1.9.2 --enable-pthread 
+2
source

All Articles