gpt4 book ai didi

ruby - ruby 错误 : cannot load such file -- zlib

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:04:58 25 4
gpt4 key购买 nike

当我尝试在 Ubuntu 12.10 中安装 rails 时出现此错误:

$ gem install rails
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand

所以我完全删除了 rvm:

rvm implode
sudo rm -rf ~/.rvm

删除了我的 .bashrc.bash_profile 中的脚本调用>

并检查它们是否真的被删除了:

env | grep rvm #no output, so rvm is removed
ruby -v #The program 'ruby' can be found in the following packages: blabla

我已经通过 sudo apt-get install 安装了这些:

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

然后从头开始安装

curl -L https://get.rvm.io | bash -s stable --ruby --auto-dotfiles

然后运行该行并根据此消息重新启动终端:

  * To start using RVM you need to run `source /home/adige/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.

然后 rvm pkg install readline 但完成时出现错误:

...
Error running 'autoreconf -is --force', please read /home/adige/.rvm/log/readline/autoreconf.log
...
Please note that it's required to reinstall all rubies:

rvm reinstall all --force

我想它已经安装好了,对吧?在重新安装所有 ruby 之前,我当然安装了 zlib:

# w/out verify, it gives checksum error
rvm pkg install zlib --verify-downloads 1

然后运行 ​​rvm reinstall all --force 并再次完成错误:

...
Install of ruby-1.9.3-p374 - #complete
Making gemset ruby-1.9.3-p374 pristine.
Error running '' under ,
please read /home/adige/.rvm/log/ruby-1.9.3-p374/gemset.pristine.log
Making gemset ruby-1.9.3-p374@global pristine.

gemset.pristine.log

然后重新安装支持 zlib 的 ruby​​:

rvm reinstall 1.9.3-p374 --with-zlib-dir=$rvm_path/usr

返回相同的错误和same log但无论如何都完成了。

最后我尝试再次安装 rails gem 但无法加载这样的文件 -- zlib!

这是 rvm info

我做错了什么?

最佳答案

您不应该在 ubuntu 上安装 readline/zlib,请按照以下步骤操作:

rvm get head
rvm pkg remove
rvm requirements run force
rvm reinstall 1.9.3-p374

如果失败,确保包括安装过程的输出,还包括所有提到的日志文件

关于ruby - ruby 错误 : cannot load such file -- zlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14729994/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com