rvm安装正常32位。输出甚至让它看起来像yaml安装正常
Kyles-MacBook-Air:~ kpeyton$ export rvm_archflags='-arch i386'
Kyles-MacBook-Air:~ kpeyton$ export rvm_architectures='i386'
Kyles-MacBook-Air:~ kpeyton$ export rvm_configure_flags=--target=i686-apple-darwin11
Kyles-MacBook-Air:~ kpeyton$ rvm install ruby-1.9.3-p125 --32 --patch osx-arch-fix -n i386
Fetching yaml-0.1.4.tar.gz to /Users/kpeyton/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/kpeyton/.rvm/src
Configuring yaml in /Users/kpeyton/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/kpeyton/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/kpeyton/.rvm/usr
Installing Ruby from source to: /Users/kpeyton/.rvm/rubies/ruby-1.9.3-p125-i386, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125-i386 - #fetching
ruby-1.9.3-p125-i386 - #extracting ruby-1.9.3-p125 to /Users/kpeyton/.rvm/src/ruby-1.9.3-p125-i386
ruby-1.9.3-p125-i386 - #extracted to /Users/kpeyton/.rvm/src/ruby-1.9.3-p125-i386
Applying patch 'osx-arch-fix' (located at /Users/kpeyton/.rvm/patches/ruby/1.9.3/p125/osx-arch-fix.patch)
Applying patch 'xcode-debugopt-fix-r34840' (located at /Users/kpeyton/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-r34840.diff)
ruby-1.9.3-p125-i386 - #autoreconf
ruby-1.9.3-p125-i386 - #configuring
ruby-1.9.3-p125-i386 - #compiling
ruby-1.9.3-p125-i386 - #installing
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.9.3-p125-i386 ...
Installation of rubygems completed successfully.
ruby-1.9.3-p125-i386 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p125-i386 - #importing default gemsets (/Users/kpeyton/.rvm/gemsets/)
Install of ruby-1.9.3-p125-i386 - #complete
但是当我尝试使用irb并且需要'yaml'时,我收到有关未安装libyaml的错误:
Kyles-MacBook-Air:~ kpeyton$ rvm use ruby-1.9.3-p125-i386
Using /Users/kpeyton/.rvm/gems/ruby-1.9.3-p125-i386
Kyles-MacBook-Air:~ kpeyton$ irb
1.9.3p125 :001 > require 'yaml'
/Users/kpeyton/.rvm/rubies/ruby-1.9.3-p125-i386/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
=> true
谁能告诉我应该怎么做?
答案 0 :(得分:1)
使用
CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm pkg install libyaml
以32位编译libyaml,然后重新安装ruby版本:
rvm reinstall ruby-1.9.3-p125-i386 -n i386 --with-arch=i386