4

I'm trying to get rails up and running on my development server. It's a fedora14 box. I installed rvm, ruby 1.8.7, and rubygems 1.6.2. When I try to install rails via gem, gem install rails, i get the following error:

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.

Thanks in advance

3 Answers 3

9

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). The output you'll see will be similar to this:

 # 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 :( 
Sign up to request clarification or add additional context in comments.

4 Comments

I got everything installed but iconv-devel. Said there was no package. Still getting the same error after all the other packages have been installed
After doing it, make sure to recompile/reinstall ruby. rvm remove 1.8.7 and then rvm install 1.8.7.
Also, on some RedHat-based systems, iconv-devel won't be available -- don't worry about it.
@Dylan Markow: So, what is the substitution for iconv-devel on RedHat-based OS?
0

You need to install the zlib libraries. A gem is trying to use it with a C extension but it is not found. http://fr.rpmfind.net/linux/rpm2html/search.php?query=zlib-devel&system=&arch= Install zlib-devel.

1 Comment

I installed zlib-devel-1.2.5-2.fc14.i686 but still same errors
0

What this error means is that zlib library is missing. 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. I am not sure what the equivalent package in Fedora is, but you should be able to search / find that.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.