3

Stumbled right now. This is the error I keep getting (I have recently upgraded my OSX from Leopard to Snow Leopard):

redacted's Mac[~]$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/redacted/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/redacted/.rvm/src
Configuring yaml in /Users/redacted/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/redacted/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/redacted/.rvm/usr
Installing Ruby from source to: /Users/redacted/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...

ruby-1.9.3-p125 - #fetching 
ruby-1.9.3-p125 - #extracted to /Users/redacted/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring 
ruby-1.9.3-p125 - #compiling 
Error running 'make ', please read /Users/redacted/.rvm/log/ruby-1.9.3-p125/make.log
There has been an error while running make. Halting the installation.

Looking into the log, there is this:

ld: in /usr/local/lib/libxml2.2.dylib, file was built for i386 which is not the architecture being linked (x86_64)

Googled and also searched this site, followed some recommendations including:

1) updating XCode to 3.2.6 (I am on Snow Leopard). This is not the same version as the Xcode on install DVD.

2) completely removing all traces of MacPorts (per procedures here http://www.libertypages.com/clarktech/?p=743), including deleting /opt/local where my MacPort stuff were previously

3) Completely removing all traces of RVM (per procedures here How can I remove RVM (Ruby Version Manager) from my system?)

4) Installing MacPorts for Snow Leopard, and running sudo port -v selfupdate

5) sudo port install libxml2 libxslt (I confirm that it appears to be using x86_64 architecture - here's what it looked like for libxml2:

--->  Computing dependencies for libxml2
--->  Dependencies to be installed: zlib
--->  Fetching archive for zlib
--->  Attempting to fetch zlib-1.2.6_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/zlib
--->  Attempting to fetch zlib-1.2.6_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/zlib
--->  Installing zlib @1.2.6_0
--->  Activating zlib @1.2.6_0
--->  Cleaning zlib
--->  Fetching archive for libxml2
--->  Attempting to fetch libxml2-2.7.8_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/libxml2
--->  Attempting to fetch libxml2-2.7.8_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/libxml2
--->  Installing libxml2 @2.7.8_0
--->  Activating libxml2 @2.7.8_0
--->  Cleaning libxml2

6) installing RVM

7) At this point, my library files, RVM, MacPorts, XCode seem to be the latest and correct architecture

8) rvm install 1.8.7 was successful

9) rvm install 1.9.2 and 1.9.3 fails, with the error messages shown at beginning of this question.

Any ideas what I've missed? I noticed this while poking around trying various things from reading articles:

file /usr/local/lib/libxml2.2.dylib

/usr/local/lib/libxml2.2.dylib: Mach-O dynamically linked shared library i386

Not sure if this is significant.. Odd that it still thinks libxml2 is i386 when MacPorts seem to have installed the x86_64 version.

-> edit about 21 mins after I posted this - actually, I'm seeing the macport file as 64 bit I believe, so is it possible the library file path is set up wrong while rvm tries to install 1.9.2/1.9.3? (see below)

file /opt/local/lib/libxml2.2.dylib
/opt/local/lib/libxml2.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Here's my PATH:

redacted's Mac[~]$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Users/redacted/.rvm/bin

rvm info:

system:

  system:
    uname:       "Darwin redacted-macbook-pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
    zsh:         "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"

  rvm:
    version:      "rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
    updated:      "3 hours 26 minutes 47 seconds ago"

  homes:
    gem:          "not set"
    ruby:         "not set"

  binaries:
    ruby:         "/usr/local/bin/ruby"
    irb:          "/usr/local/bin/irb"
    gem:          "/usr/local/bin/gem"
    rake:         "/usr/local/bin/rake"

  environment:
    PATH:         "/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Users/redacted/.rvm/bin"
    GEM_HOME:     ""
    GEM_PATH:     ""
    MY_RUBY_HOME: ""
    IRBRC:        ""
    RUBYOPT:      ""
    gemset:       ""

No idea how to proceed at this point; I've basically uninstalled and reinstalled everything twice to no avail.

-> edit: adding this for steve

[2012-02-24 22:54:41] make 
    CC = /usr/bin/gcc-4.2
    LD = ld
    LDSHARED = /usr/bin/gcc-4.2 -dynamiclib
    CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration  -fno-common -pipe 
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I. -I.ext/include/x86_64-darwin10.8.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/craigflannagan/.rvm/rubies/ruby-1.9.3-p125/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,_Init_* -Wl,-unexported_symbol,*_threadptr_*  -Wl,-u,_objc_msgSend   
    SOLIBS = 
linking miniruby
rbconfig.rb unchanged
generating enc.mk
generating prelude.c
compiling prelude.c
linking static-library libruby.1.9.1-static.a
linking shared-library libruby.1.9.1.dylib
generating encdb.h
encdb.h unchanged
making enc
make[1]: Nothing to be done for `enc'.
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
making trans
make[1]: Nothing to be done for `./enc/trans'.
making encs
installing default bug libraries
installing default resize libraries
installing default bug libraries
installing default bug libraries
installing default funcall libraries
installing default dot.dot libraries
installing default old_thread_select libraries
installing default numhash libraries
installing default string libraries
installing default wait_for_single_fd libraries
installing default bigdecimal libraries
installing default continuation libraries
installing default coverage libraries
installing default curses libraries
installing default date_core libraries
make[2]: Nothing to be done for `all'.
installing digest libraries
installing default digest libraries
installing default bubblebabble libraries
installing default md5 libraries
installing default rmd160 libraries
installing default sha1 libraries
installing default sha2 libraries
installing dl libraries
installing default dl libraries
installing default callback libraries
make[2]: Nothing to be done for `all'.
installing default etc libraries
installing default fcntl libraries
installing default fiber libraries
installing default fiddle libraries
make[2]: Nothing to be done for `all'.
installing default iconv libraries
installing default console libraries
installing default nonblock libraries
installing default wait libraries
installing default libraries
installing default generator libraries
installing default parser libraries
installing default complex libraries
installing default rational libraries
installing default nkf libraries
installing default objspace libraries
installing default openssl libraries
installing default pathname libraries
installing default psych libraries
installing default pty libraries
installing default cparse libraries
installing default readline libraries
installing default ripper libraries
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default sdbm libraries
installing default socket libraries
installing default stringio libraries
installing default strscan libraries
installing default syck libraries
installing default syslog libraries
linking shared-object tcltklib.bundle
ld: in /usr/local/lib/libxml2.2.dylib, file was built for i386 which is not the architecture being linked (x86_64)
collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-darwin10.8.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2
Community
  • 1
  • 1
Craig Flannagan
  • 579
  • 1
  • 7
  • 16
  • This isn't a good question for stackoverflow. You should post it on http://serverfault.com instead. – Ben Lee Feb 25 '12 at 02:35
  • You might be right but I'm not sure I understand why - this question has nothing to do with a server, it's me trying to install a Ruby version on my laptop so I can resume my development efforts. – Craig Flannagan Feb 25 '12 at 02:38
  • Okay, perhaps I misunderstood the question. Maybe this it is a good fit for stackoverflow. When it comes to things like software installation problems, I suppose it's a gray area. – Ben Lee Feb 25 '12 at 02:46
  • In any case, people with the requisite experience to help are likely to be present on both sites. – Ben Lee Feb 25 '12 at 02:47
  • 3
    I think getting a dev environment up and running is legit for stackflow, and he's clearly done some homework (as opposed to the bazillion other "my ruby doesn't work!" posts). – Marc Talbot Feb 25 '12 at 02:48
  • Maybe we're both wrong. Someone already asked a question very similar to yours on *superuser* and got an answer: http://superuser.com/questions/389806/problems-installing-ruby-1-9-3-on-snow-leopard (don't know if this will help you, but figured I'd post it just in case) – Ben Lee Feb 25 '12 at 02:50
  • @MarcTalbot, it's definitely a good question, I never meant to imply otherwise. And I realize now I was probably wrong about where it goes. 973 questions tagged rvm on stackoverflow vs only 36 on serverfault (and 22 on superuser). – Ben Lee Feb 25 '12 at 02:54
  • Ben - the superuser question/answer you posted doesn't seem to be close to the issue I'm experiencing here ;) My issue appears to be architectural issue in nature, whereas that link was about someone having something already linked. Thanks though, *grin* – Craig Flannagan Feb 25 '12 at 02:59

2 Answers2

0

The problem is you are only setting the PATH variable. However this environment variable is not used for finding shared libraries. You need to set the DYLD_LIBRARY_PATH environment variable. Also have a look at 'man dyld'.

steve
  • 5,416
  • 1
  • 16
  • 20
  • Sounds promising - to which folder should I point that enviornment variable to? I tried "export DYLD_LIBRARY_PATH=/opt/local/lib" and got same result (complaining about architectural differences) when trying to do "rvm install 1.9.3" – Craig Flannagan Feb 25 '12 at 03:34
  • Theoretically this should work. I'm wondering if the makefile is linking with a hard coded path. Would you mind post the ld command with its parameters. – steve Feb 25 '12 at 04:00
  • Added to my original question above per your request (comment has about 550 character limit). Seems to still be looking at the non-Macport-installed libxml2 file, even after setting DYLD_LIBRARY_PATH. Was there something else I need to modify before trying "rvm install 1.9.3"? – Craig Flannagan Feb 25 '12 at 04:08
  • Could this be the offending line in Makefile? (I am not an expert on subject matter of Makefiles in general) $ cat Makefile | grep /usr/local LDFLAGS = $(CFLAGS) -L. -L/usr/local/lib – Craig Flannagan Feb 25 '12 at 04:19
  • Here's something interesting: I got out my work laptop, which has nearly identical setup (Snow Leopard, RVM, Ruby 1.9.2/1.9.3, etc) and it turns out I don't even have /usr/local/lib! It's actually renamed to /usr/local/lib.old. Looking into this, I seem to find recommendations to remove /usr/local/lib as well (http://apple.stackexchange.com/questions/9992/homebrew-wants-me-to-delete-usr-local-lib). Thoughts? – Craig Flannagan Feb 25 '12 at 04:39
  • not good. This means it does not recognize the environment variable. One other thing how do you invoke macports? – steve Feb 25 '12 at 06:29
  • not sure what you mean - I typically do things like "sudo port install libxml2 libxslt", is that what you were asking about? – Craig Flannagan Feb 25 '12 at 22:24
0

you need to update to remove older Xcode and install Xcode 4.1 or use osx-gcc-installer

please read rvm requirements for more details on what's needed for proper ruby installation

mpapis
  • 51,279
  • 14
  • 117
  • 159
  • From rvm requirements: " Notes for Darwin ( Mac OS X ) For Snow Leopard: Xcode Version 3.2.1 (1613) or later, such as 3.2.6 or Xcode 4.1." Doesn't seem to mention 4.1 is required, though. Before I try upgrading, I'm hoping for an explanation on how this would solve my issue - seeing how I can get it to work using 3.2.6 if I take /usr/local/lib out of circulation by renaming it to /usr/local/lib.old. Would 4.1 update contents of /usr/local/lib and get things working for me again? (I'm not an expert on what exactly XCode will modify on my file/folders when I install an updated version). – Craig Flannagan Mar 09 '12 at 16:22
  • @CraigFlannagan Xcode 3.2.6 could still work with Ruby 1.8.6/7 ... I have no array of the possible combinations, I headrd only that best results you get with 4.1 – mpapis Mar 09 '12 at 20:30