简体   繁体   English

尝试运行 gem install 时出错

[英]Error when trying to run gem install

I'm trying to get rails up and running on my development server.我正在尝试在我的开发服务器上启动并运行 Rails。 It's a fedora14 box.这是一个fedora14盒子。 I installed rvm, ruby 1.8.7, and rubygems 1.6.2.我安装了 rvm、ruby 1.8.7 和 rubygems 1.6.2。 When I try to install rails via gem, gem install rails , i get the following error:当我尝试通过 gem、 gem install rails时,出现以下错误:

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

Any ideas as to what is going on.关于发生了什么的任何想法。 I'm 100% new to ruby/rubygems/rails and I know enough about Linux to be dangerous so any help/suggestions would be greatly appreciated.我是 ruby/rubygems/rails 的 100% 新手,我对 Linux 非常了解,因此非常感谢任何帮助/建议。

Thanks in advance提前致谢

Run rvm notes and install whatever it tells you ( zlib-devel will probably be one of the packages you'll need to install via yum ).运行rvm notes并安装它告诉您的任何内容( zlib-devel可能是您需要通过yum安装的软件包之一)。 The output you'll see will be similar to this:您将看到的 output 将与此类似:

  # For Ruby (MRI & Ree) you should install the following OS dependencies:
  ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel ;
        yum install -y make bzip2 ;
        yum install -y iconv-devel # NOTE: For centos 5.4 final iconv-devel might not be available :(

You need to install the zlib libraries.您需要安装 zlib 库。 A gem is trying to use it with a C extension but it is not found. gem 正在尝试将它与 C 扩展一起使用,但找不到。 http://fr.rpmfind.net/linux/rpm2html/search.php?query=zlib-devel&system=&arch= Install zlib-devel. http://fr.rpmfind.net/linux/rpm2html/search.php?query=zlib-devel&system=&arch=安装zlib-devel。

What this error means is that zlib library is missing.此错误意味着缺少 zlib 库。 This is a common problem and if you google for it, you'd find loads of information on the same.这是一个常见的问题,如果你用谷歌搜索它,你会发现大量的信息。 In ubuntu (where I work) installing the package zlib1g-dev and zlib1g fixes it.在 ubuntu(我工作的地方)安装 package zlib1g-dev 和 zlib1g 修复它。 I am not sure what the equivalent package in Fedora is, but you should be able to search / find that.我不确定 Fedora 中等效的 package 是什么,但您应该能够搜索/找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM