Building ruby on rails

Hello,

I have downloaded ruby-1.91-1-p376, configured and built

(./configure --with-pthreads; make;make install)

downloaded rubygem 1.3.5, unpacked, then

ruby setup.rb

And when I run

gem install rails

I get the following error:

gem install rails

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:10:in require': no such file to load -- zlib (LoadError) from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:10:in<top (required)>’
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:9:in
require' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:9:in<top (required)>’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:11:in
require' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:11:in<top (required)>’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:3:in
require' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:3:in<top (required)>’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:4:in
require' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:4:in<top (required)>’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:167:in
require' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:167:inrescue in load_and_instantiate’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:159:in
load_and_instantiate' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:88:in[]’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:144:in
find_command' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:131:inprocess_args’
from
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:102:in
run' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:58:inrun’
from /usr/local/bin/gem:21:in `’

when I check nohup.out from the make and grep for zlib I see the
following:

grep zlib noh*

nohup.make:compiling zlib

And checking the nohup.out from the install I get the following for the
required packages in ‘package.rb’ (e.g., stringio and yaml)

nohup.out:ext/zlib/zlib.c:
MCCCCCCCCCCCCCCCCCCmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

grep zlib .installed*

/usr/local/share/ri/1.9.1/system/Zlib/zlib_version-c.yaml

grep stringio .installed*

/usr/local/lib/ruby/1.9.1/yaml/stringio.rb
/usr/local/lib/ruby/1.9.1/powerpc-aix5.3.0.0/stringio.so

grep fileutils .installed*

/usr/local/lib/ruby/1.9.1/fileutils.rb

It looks like zlib has been compiled, but not installed?

These are the zlib files in the package area:

pwd

/data/prj/ruby-1.9.1-p376

find . | grep zlib

./ext/zlib
./ext/zlib/.cvsignore
./ext/zlib/doc
./ext/zlib/doc/zlib.rd
./ext/zlib/extconf.rb
./ext/zlib/zlib.c
./ext/zlib/mkmf.log
./ext/zlib/Makefile
./.ext/rdoc/Zlib/zlib_version-c.yaml
./test/zlib
./test/zlib/test_zlib.rb

These are the ‘zlib’ files in the installed area:

cd /usr/local

find . | grep zlib

./share/ri/1.9.1/system/Zlib/zlib_version-c.yaml

Suggestions welcome.

I have come a bit further, but not found a solution.

via IRC i was pointed at this “rejected” bug-report:
http://redmine.ruby-lang.org/issues/show/1157

However, regardless of whether I re-run configure with
CFLAGS=/usr/local/include (where zlib.h is located), or not during make
the
flag -I/usr/include/local is not added to the test, so make “fails” in
that
zlib.rb and/or Makefile in ./ext/zlib does not get made.

for ./ext/zlib/mkmf.log

have_header: checking for zlib.h… -------------------- no

“cc -qlanglvl=extc89 -E -I…/…/.ext/include/powerpc-aix5.3.0.0
-I…/…/./include -I…/…/./ext/zlib -D_LARGE_FILES=1
-I/usr/lib/include
-g conftest.c > conftest.i”
“conftest.c”, line 3.10: 1506-296 (S) #include file <zlib.h> not found.
checked program was:
/* begin /
1: #include “ruby.h”
2:
3: #include <zlib.h>
/
end */

If I am missing something - not obvious to me - please suggest!

Michael Felt wrote:

I have downloaded ruby-1.91-1-p376, configured and built

(./configure --with-pthreads; make;make install)

downloaded rubygem 1.3.5, unpacked, then

ruby setup.rb

And when I run

gem install rails

I get the following error:

gem install rails

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:10:in `require’:
no
such file to load – zlib (LoadError)

This means that ruby zlib library wasn’t built when you were building
ruby 1.9, but rubygems needs it.

The solution depends on what system you are building under. For example,
if you are building under Ubuntu, then you need to do

sudo apt-get install zlib1g-dev

then reconfigure and rebuild ruby 1.9 from scratch, so it can detect the
zlib header files and build the ruby zlib extension, then try and build
rubygems again.

I’d also recommend

sudo apt-get install libssl-dev

before building ruby, because without this, ruby won’t have openssl
support and hence can’t do HTTPS.

Regards,

Brian.

My “solution” was a lot simplier. As all the files were there but
miniruby/ruby installer was not finding them I just copied zlib.h and
zconf.h (inserted by zlib.h) into /include (the
…/…/include
reference) and the build and gem install worked fine after that.

Thanks for the advice!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs