I apologize for my ignorance - I'm very new to this - but I have tried everything and cannot get 1.9.2 installed using RVM. I believe I have installed RVM correctly, and when I go to install 1.9.2 I get the following error in my make log when ruby tries to compile:
ld: in /usr/local/lib/libz.1.dylib, file was built for unsupported file format which is
not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../../.ext/x86_64-darwin10.6.0/digest/md5.bundle] Error 1
make: *** [mkmain.sh] Error 1
Some other information: I was running OS X in 32 bit, and received a similar error - replace the (x86_64) with I believe (i36). I am now running in 64 bit.
*Update*:
I have done everything TinMan has asked me to do, and still no avail - Just want to point out that I can install 1.8.7 just fine. Attempting to install 1.9.1 and 1.9.2 gives me the following error message:
`Installing Ruby from source to: /Users/tl/.rvm/rubies/ruby-1.9.2-p180, this may take a while depending on your cpu(s)...
ruby-1.9.2-p180 - #fetching
ruby-1.9.2-p180 - #downloading ruby-1.9.2-p180, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8609k 100 8609k 0 0 655k 0 0:00:13 0:00:13 --:--:-- 939k
ruby-1.9.2-p180 - #extracting ruby-1.9.2-p180 to /Users/tl/.rvm/src/ruby-1.9.2-p180
ruby-1.9.2-p180 - #extracted to /Users/tl/.rvm/src/ruby-1.9.2-p180
ruby-1.9.2-p180 - #configuring
ruby-1.9.2-p180 - #compiling
ERROR: Error running 'make ', please read /Users/tl/.rvm/log/ruby-1.9.2-p180/make.log
ERROR: There has been an error while running make. Halting the installation.`
Additionally, I have upgraded my autoconf, automake, m4, and libtools.
Lastly, my path and .bash_profiles respectively look like:
PATH
`/usr/local/upgraded/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin`
.bash
`export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"`
*Update 2*
I updated my autoconf, automake, m4, and libtools following the instructions here:
http://tom.meinlschmidt.org/2010/11/22/upgrade-autoconfautomake-in-osx/
RVM Info:
`system:
system:
uname: "Darwin Tam-Les-MacBook-Pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:11:58 PST 2010; root:xnu-1504.9.26~3/RELEASE_X86_64 x86_64"
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.5.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/usr/local/upgraded/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/opt/local/bin:/Users/tl/.rvm/bin:/Users/tl/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""`
Also, your PATH doesn't look like RVM has been allowed to initialize itself. When RVM has been initialized it will put its path to your ~/.rvm first.
How do you do that? I'm really new to this, and have gotten this far through sheer guess work. Inefficient I know.
*Update 3*
Hi all - it's been a while since I've given up on this, but I am going to try again this weekend. Thanks for all the advice and I'll let you know what happens from there. For a newbie such as myself, I severely underestimated how difficult just installing something is.
I don't know if you're still on it, but i succeeded just by doing this ::
sudo rm /usr/local/lib/libz.*
:)
Probably some software has installed a wrong lib... Well wrong architecture
When you upgrade from 32bit to 64bit, all the Ruby binaries under RVM's control need to be recompiled. This means Ruby and gems with compiled C.
Here's a couple steps to try off the top of my head, having done this a while back:
- Make sure your XCode is current. Do NOT trust the version on the Snow Leopard DVD as it's corrupt. Download AND INSTALL a current copy from Apple's XCode site.
- Update your RVM using
rvm get head
. The current rev. of RVM is 1.5.1, having updated yesterday.
- Reinstall all your Rubies using
rvm uninstall
with the version of Ruby, followed by rvm install
with the same version number. That should bring the Ruby versions to 64-bit.
- Rebuild the gems using
gem pristine -all
for each installed Ruby. You could probably do them all automatically using rvm ruby 'gem pristine --all'
.
Edit:
[...] I was able to successfully install 1.8.7 but am still receiving the same error for 1.9.2. Is there something else I'm missing? Does the .bash_profile matter in this situation?
Try typing rvm notes
and follow the instructions for handling dependencies for Mac OS. You might be missing something that is causing the problem. If that doesn't help edit your original question with the text of the error message so we can see it.
[...] when it goes through the extraction phase it says: '#extracted to /Users/tl/.rvm/src/ruby-1.9.2-p180 (already extracted)'
Ah, been there. Do rm ~/.rvm/src/ruby-1.9.2-p180/*
to empty that directory. RVM downloads the tarball for a particular Ruby into the ~/.rvm/archive
dir, then extracts it to ~/.rvm/src
. If something goes wrong during the extract it might have only some of the files, which causes a failure during the configuration/make cycle.
Edit:
have upgraded my autoconf, automake, m4, and libtools
HOW did you install and upgrade them? Ruby on Mac OS requires Apple's headers and XCode.
Please add the output of rvm info
to your original question. It will have all sorts of environment info.
Also, your PATH doesn't look like RVM has been allowed to initialize itself. When RVM has been initialized it will put its path to your ~/.rvm
first.
Edit:
The output from rvm info
shows that RVM has not been initialized. It is installed, but that is not the same thing.
- CAREFULLY read the documentation, and check-off that you have done the steps in the "Post-Install" section of "Installation" on the RVM site. Go through the "Troubleshooting your Install" section also, then do it again.
- Confirm that you have installed the current version of Apple's XCode development system.
I think this is caused by a previous MacPorts installation. removing those symbols / whatelse by running
sudo rm /usr/local/lib/libz.*
fixed it for me
I gave up trying to install Ruby 1.9.3 using RVM on OS X 10.8, and used homebrew to do so.
It worked like a charm -- installs ruby with one single command:
$ brew install ruby
This should work out-of-the-box if you haven't done any crazy things to your OS X install. What I suggest:
- Try reinstalling the Developer Tools from scratch.
- Create a new user in OS X, log in and try installing RVM there in the normal fashion
Since your RVM installation is only for your 'tl' user trying out RVM with a brand new user gives you a bit of a clean start. If installing RVM + Ruby 1.9.2 fails with the new user as well then I suggest reinstalling your machine since there's probably too much going on.
Some program has installed a version of zlib into your /usr/local that cannot be used to link Ruby against it because it's (I suppose) i386 and your Ruby-in-minting is x64.
Your options:
1) Temporarily move /usr/local out of the way altogether by doing a simple rename
$mv /usr/local /usr/local-disabled
and try compiling again. This is kind of a hardcore measure but this is likely to give you the right libraries linked.
2) Bend RVM to build Ruby with architecture that fits this zlib you have in there. First use file
and check which arch your zlib is.
$file /usr/local/lib/libz.1.dylib
/usr/local/lib/libz.1.dylib: Mach-O dynamically linked shared library i386
This will tell you for which arch you need to configure RVM
Place the following in your ~/.rvmrc file:
rvm_archflags="-arch i386"
3) Install a newer zlib which will likely compile with proper arch by default - http://www.zlib.net/ and then retry building your ruby with default settings.
4) Indeed as Piotr suggested just deleting the offending copy of zlib and see which program will segfault looking for it :-P
Try this, works like a charm: https://rvm.io/packages/zlib/
rvm pkg install zlib
rvm reinstall 1.9.2 --with-zlib
RVM depends on Homebrew under MacOSX, so either way you'll get back to the case calling
brew install ruby