0

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 

谁能告诉我我应该怎么做?

4

1 回答 1

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
于 2012-07-07T08:09:33.310 回答