EC2 上的 ruby​​ 安装 zlib 问题

发布于 2024-10-15 18:09:05 字数 796 浏览 3 评论 0原文

我读过一篇类似的文章,但我没有使用 ubuntu,也没有 apt-get。

仅供参考,uname:x86_64 x86_64 x86_64 GNU/Linux

当尝试执行“gem installrails”时,我得到

[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand

但是,当我执行“yum install zlib”时,它说已安装。

[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# yum install zlib
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Package zlib-1.2.3-24.6.amzn1.x86_64 already installed and latest version
Nothing to do

我尝试了 which zlib 并确认它不存在。有什么建议吗?

谢谢。

I read a similar post but I am not using ubuntu, and do not have apt-get.

fyi, uname: x86_64 x86_64 x86_64 GNU/Linux

When attempting to do "gem install rails", I get

[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# gem install rails
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand

However, when I do "yum install zlib", it says that is installed.

[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# yum install zlib
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Package zlib-1.2.3-24.6.amzn1.x86_64 already installed and latest version
Nothing to do

I tryed which zlib and have confirmed it doesn't exist. Any tips?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风为裳 2024-10-22 18:09:05

是的!我在这里找到了答案: http: //lucaschan.com/weblog/2007/03/22/installing-ruby-on-rails-on-centosredhat-4x/

我只需要他的指令的一个子集,即进入源代码

cd ruby-1.9.2-p136/ext/zlib/
ruby extconf.rb --with-zlib-include=/usr/include --width-zlib-lib=/usr/lib
gem install rails --include-dependencies

:它!感谢卢卡斯;)

Yes! I found an answer here: http://lucaschan.com/weblog/2007/03/22/installing-ruby-on-rails-on-centosredhat-4x/

I only needed a subset of his instructions which was to go into the source and:

cd ruby-1.9.2-p136/ext/zlib/
ruby extconf.rb --with-zlib-include=/usr/include --width-zlib-lib=/usr/lib
gem install rails --include-dependencies

That's it! Thanks to Lucas;)

浅笑依然 2024-10-22 18:09:05

前几天我遇到了这个问题,我的解决方案是:“切换到 REE”...它正确安装了 gems

I ran into this problem the other day, and my solution was: "switch to REE"... which correctly installed gems

转身以后 2024-10-22 18:09:05

我通过搜索修复了这个错误。

http://ubuntuforums.org/showthread.php?t=1494997#post11359766

sudo apt-get install zlib1g-dev
cd /ruby-source-files/ext/zlib
#rvm ~/.rvm/src/ruby-*.*.*/ext/zlib
ruby extconf.rb
make
sudo make install

I fixed this error through search.

http://ubuntuforums.org/showthread.php?t=1494997#post11359766

sudo apt-get install zlib1g-dev
cd /ruby-source-files/ext/zlib
#rvm ~/.rvm/src/ruby-*.*.*/ext/zlib
ruby extconf.rb
make
sudo make install
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文