带有TK安装的RVM Ruby(OSX) [英] RVM Ruby with TK installation (OSX)
问题描述
我正在尝试安装具有TK支持的Ruby.
I'm trying to install Ruby with TK support.
我使用RVM,是这样做的:
Using RVM, I did this:
rvm install 1.9.2 -C --enable-shared --enable-pthread
安装似乎可以正常工作,我可以看到一个叫做
The installation appears to work fine, and I can see something called
.rvm/src/ruby-1.9.2-p320/ext/tk/tcltklib.c
我认为那是我需要的图书馆?
which I assume is the library I need?
然后我尝试运行
require 'tk'
在irb中,但收到错误消息
in irb, but get the error message
LoadError: no such file to load -- tk
有什么想法吗?
如果有人对在OSX上支持TK的Ruby升级到2.0.0的步骤的完整列表感兴趣,这就是我所做的:
If anyone is interested in the complete list of steps for a Ruby upgrade to 2.0.0 with TK support on OSX, this is what I did:
为Ruby安装RVM-
Install RVM for Ruby -
\curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
从ActiveTcl安装TK- http://www.activestate.com/activetcl
Install TK from ActiveTcl - http://www.activestate.com/activetcl
运行
rvm reinstall 2.0.0 --enable-shared --enable-pthread --with-tk --with-tcl
启动irb并检查TK安装是否成功
Fire up irb and check the TK installation was successful with
require 'tk'
推荐答案
RVM默认禁用tk/tcl(在OS X上存在问题),您需要告诉ruby(通过rvm)要tk/tcl:
RVM disables tk/tcl by default (problems on OS X), you need to tell ruby (via rvm) you want tk/tcl:
rvm install 1.9.2 --enable-shared --enable-pthread --with-tk --with-tcl
这篇关于带有TK安装的RVM Ruby(OSX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!