2012-09-11 172 views
14

我将rvm升级到1.15.8,然后在zsh中出现问题后回到1.15.7。降级后,我的Ruby 1.9+版本恢复正常,但1.8.7不会再次安装。rvm无法在Mac OS X上安装1.8.7-p352 Mountain Lion

有正在发生的两个错误:

Error running 'patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/me/.rvm/log/ruby-1.8.7-p352/patch.apply.stdout-rouge-fix.log 

该文件的内容是:

[2012-09-11 01:05:59] patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch" 
patching file lib/mkmf.rb 
Hunk #1 FAILED at 201. 
1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej 

和:

Error running 'make ', please read /Users/me/.rvm/log/ruby-1.8.7-p352/make.log 

出现了,同时运行的信息有误。停止安装。

和文件的内容(有错误开始只有前几行):

Fail to find [tclConfig.sh, tkConfig.sh] 
Use MacOS X Frameworks. 

Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk. 
gcc-4.2 -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2011-06-30\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2 -fno-common -pipe -fno-common -c stubs.c 
In file included from stubs.c:10: 
/usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory 
In file included from stubs.c:10: 
/usr/include/tk.h:549: error: expected declaration specifiers or ‘...’ before ‘Window’ 
/usr/include/tk.h:549: error: ‘Window’ declared as function returning a function 
/usr/include/tk.h:552: error: expected declaration specifiers or ‘...’ before ‘XEvent’ 
/usr/include/tk.h:561: error: expected specifier-qualifier-list before ‘Tk_ClassCreateProc’ 
/usr/include/tk.h:655: error: expected specifier-qualifier-list before ‘Bool’ 
/usr/include/tk.h:677: error: expected specifier-qualifier-list before ‘Bool’ 
/usr/include/tk.h:756: error: expected specifier-qualifier-list before ‘Display’ 
/usr/include/tk.h:902: error: expected declaration specifiers or ‘...’ before ‘XPoint’ 
/usr/include/tk.h:996: error: expected declaration specifiers or ‘...’ before ‘Display’ 

一个支持我的应用程序是1.8.7。我死在水中。这看起来可能是山狮VS rvm的问题。任何人都可以将我指向正确的方向吗?

UPDATE:

我得到了这样做的第一个错误“重装”,而不只是“安装”。尽管1.8.7-p352不在命令“rvm list rubies”给出的红宝石列表中。

+0

你应该发布http://serverfault.com/或http://superuser.com/ – maxdec

+0

@Double我回答了大多数RVM的问题 - 其中大部分都发布在这里 - 将它们发布到别处大多数可能会有更长的时间获得答案。 – mpapis

回答

33

它是在由红宝石1.8.7检测的Tcl/Tk的问题,解决的办法是将其禁用:

rvm reinstall 1.8.7 --without-tcl --without-tk 

需要的Tcl/Tk当其它的解决方案:https://stackoverflow.com/a/11666019/497756

+0

什么是tcl/tk?我怎么知道我会需要他们?编辑:当我想构建一个红宝石GUI时,我只需要tcl和tk吗? (http://rubylearning.com/satishtalim/ruby_tk_tutorial.html) – crispy

+0

如果你不知道他们是什么,那么你不需要它,这是非常旧的方式,它很少使用,因为界面非常丑陋 – mpapis

+0

它看起来像一个非常糟糕的想法,默认包括这些。 – tadman

6

我想在这里结束了关于sf的两个类似问题。我的主要问题是tcl.h包含Mountain Lion上的文件(位置:/usr/include/tcl.h symlinked)无法解析它必须使​​用的“X11/Xlib.h”。我认为通过自制软件安装tcl和tk可以通过生成可解决的Xlib.h路径来解决问题。所以,我跑:

brew install tcl 

和:

brew install tk 

和:

rvm remove 1.8.7-p352 
rvm install 1.8.7-p352 

和它的工作。但是,米哈尔的回答上面的答案我也认为是一样的。这个答案将有助于人们构建需要tcl和tk的应用程序。

+0

自制软件似乎不再有tcl和tk。 –

+0

'brew install homebrew/dupes/tcl-tk' should work,I think。 –

相关问题