14

I upgraded rvm to 1.15.8, then went back down to 1.15.7 after having some problems in zsh. After downgrading, my Ruby 1.9+ versions went back in fine, but 1.8.7 won't install again.

There are two errors that are occurring:

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

The contents of that file are:

[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

and:

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

There has been an error while running make. Halting the installation.

and the contents of that file are (only the first few lines beginning with the errors):

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’

One of the applications I support is 1.8.7. I am dead in the water. This looks like it might be a problem with Mountain Lion vs. rvm. Can anyone point me in the right direction?

UPDATE:

I got over the first error by doing "reinstall" instead of just "install". Even though 1.8.7-p352 was not in the list of rubies given by the command "rvm list rubies".

RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
  • You should maybe post this on http://serverfault.com/ or http://superuser.com/ – maxdec Sep 11 '12 at 06:35
  • @Double I answer most of the RVM questions - and most of them are posted here - posting them elsewhere will most likely longer the time to get answer. – mpapis Sep 11 '12 at 12:03

2 Answers2

33

it is problem in detecting tcl/tk by ruby 1.8.7, the solution is to disable it:

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

the other solution when tcl/tk is needed: https://stackoverflow.com/a/11666019/497756

Community
  • 1
  • 1
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • What is tcl/tk? How do I know wether i will need them? Edit: Do I only need tcl and tk when I want to build a ruby GUI? (http://rubylearning.com/satishtalim/ruby_tk_tutorial.html) – crispy Jan 25 '13 at 07:27
  • if you did not know what they are then you do not need it, it's really old way and it's rarely used as the interfaces are very ugly – mpapis Jan 25 '13 at 12:51
  • It seems like a very bad idea to include these by default. – tadman Feb 07 '13 at 18:20
6

I think I ended up with two similar questions on sf here. My main problem was that the tcl.h include file on Mountain Lion (location: /usr/include/tcl.h symlinked) could not resolve an internal reference it had to "X11/Xlib.h". I thought that installing tcl and tk through homebrew would fix the problem by generating a path to Xlib.h that could be resolved. So I ran:

brew install tcl

and:

brew install tk

and:

rvm remove 1.8.7-p352
rvm install 1.8.7-p352

and it worked. But Michal's answer above would have worked just as well I think. This answer will serve to help people build it that need tcl and tk.

RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193