ruby gem install bundler ERROR:no such file to load -- zlib

使用rvm安装完ruby1.9.2后运行gem install bundler命令,报以下错误:

ERROR: Loading command: install (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand
#一开始认为是zlib包没安装使用以下命令还是报以上错误
sudo apt-get install zlib1g-dev zlib1g

#后来发现是ruby的zlib包没装
rvm pkg install zlib
rvm remove 1.9.2
rvm install 1.9.2

参考:1.