我正在尝试在 Ubuntu 12.10 上从头开始安装 ruby on rails。获取帮助这个帖子:
echo "[[ -s '${HOME}/.rvm/scripts/rvm' ]] && source '${HOME}/.rvm/scripts/rvm'" >> ~/.bashrc
echo "[[ -s '${HOME}/.rvm/scripts/rvm' ]] && source '${HOME}/.rvm/scripts/rvm'" >> ~/.zshrc
curl -L https://get.rvm.io | bash -s stable
# Then run this in order to make rvm work:
source /home/adige/.rvm/scripts/rvm
# And installed zlib, before ruby:
rvm pkg install zlib
# Last step, installed ruby:
rvm install 1.9.3 --with-zlib-dir=/home/adige/.rvm/usr
但问题是当我尝试安装 gems 时出现了这个错误:
adige@adige-LG:~$ gem install rails
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
我已经有了这些:
curl zlib1g-dev zlib1g libssl-dev build-essential openssl libreadline6 libreadline6-dev curl git-core libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
那么可能存在什么问题呢?
答案1
答案2
我遇到了类似的问题,运行以下命令对我有帮助:
rvm pkg install zlib
和
rvm use --default <your_ruby_version>
另外,请确保您的终端设置为作为登录 shell 运行,方法是:
编辑->配置文件首选项->标题和命令
并勾选‘以登录 shell 身份运行命令’框。