Centos - failed to map segment from shared object: Permission denied

8,063 views
Skip to first unread message

phx

unread,
Apr 2, 2009, 2:51:30 PM4/2/09
to Phusion Passenger Discussions
Hey Group,

im getting the following error on httpd start (after mod_passenger
installation):

Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 1of /etc/httpd/conf/
rails.conf: Cannot load /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
passenger-2.1.2/ext/apache2/mod_passenger.so into server: /opt/ruby-
enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2/ext/apache2/
mod_passenger.so: failed to map segment from shared object: Permission
denied [FAILED]

Im on CentOS 5.3 with ruby-enterprise-1.8.6-20090201.

Thanks for your help!

phx

isaac....@gmail.com

unread,
Apr 6, 2009, 10:11:40 AM4/6/09
to Phusion Passenger Discussions
Hey there phx,

I had the same prob. Turns out SELinux is on & causing the issue.
Either configure SELinux to enable loading passenger module or disable
SELinux. For more info, refer to the following:

http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it

Cheers!

Zac

phx

unread,
Apr 6, 2009, 11:23:49 AM4/6/09
to Phusion Passenger Discussions
Hey Zac,

thanks for your help, just found the same solution :)

I disabled the hole SELinux thing (system-config-securitylevel), cause
im on VirtualBox.

Greetings,
phx

On 6 Apr., 16:11, "isaac.zach...@gmail.com" <isaac.zach...@gmail.com>
wrote:
> Hey there phx,
>
> I had the same prob. Turns out SELinux is on & causing the issue.
> Either configure SELinux to enable loading passenger module or disable
> SELinux. For more info, refer to the following:
>
> http://www.modrails.com/documentation/Users%20guide.html#_the_apache_...
>
> Cheers!
>
> Zac
>
> On Apr 3, 2:51 am, phx <zero.l...@gmail.com> wrote:
>
> > Hey Group,
>
> > im getting the following error on httpd start (after mod_passenger
> > installation):
>
> > Stopping httpd: [FAILED]
> > Starting httpd: httpd: Syntax error on line 1of /etc/httpd/conf/
> > rails.conf: Cannot load /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
> > passenger-2.1.2/ext/apache2/mod_passenger.so into server: /opt/ruby-
> > enterprise/lib/ruby/gems/1.8/gems/passenger-2.1.2/ext/apache2/
> > mod_passenger.so: failed to map segment from shared object: Permission
> > denied [FAILED]
>
> > Im onCentOS5.3 with ruby-enterprise-1.8.6-20090201.

Asif Shams

unread,
Apr 6, 2009, 12:16:32 PM4/6/09
to phusion passenger
Hi,

I have installed passengen on CentOS and with following dependencies

ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
Rails 2.3.2

Passenger Installed correctly after I restarted the apache by adding passenger configuration files paths in httpd.conf file but I get the following error message. Please look into this issue and update me what is the wrong in installation

========================================================
/usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44

==============================================================
Looking for your responce

Regards,
Asif Shams



Rediscover Hotmail®: Get quick friend updates right in your inbox. Check it out.

Asif Shams

unread,
Apr 7, 2009, 7:00:05 AM4/7/09
to phusion passenger
Hi,

Any body wants to help me on this issue

Regards,
Asif Shams

From: aasif...@hotmail.com
To: phusion-...@googlegroups.com
Subject: [phusion-passenger] phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
Date: Mon, 6 Apr 2009 09:16:32 -0700

Windows Live™: Keep your life in sync. Check it out.

isaac....@gmail.com

unread,
Apr 8, 2009, 1:19:06 AM4/8/09
to Phusion Passenger Discussions
Hi Asif,

I can try to help.

Did you do a custom compilation & installation of ruby? Can you
provide the output for the following: 'whereis ruby', 'whereis gem'

Thank you

Regards,
Zac

On Apr 7, 7:00 pm, Asif Shams <aasif_sh...@hotmail.com> wrote:
> Hi,
>
> Any body wants to help me on this issue
>
> Regards,
> Asif Shams
> From: aasif_sh...@hotmail.com
> To: phusion-...@googlegroups.com
> Subject: [phusion-passenger] phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
> Date: Mon, 6 Apr 2009 09:16:32 -0700
>
> Hi,
>
> I have installed passengen on CentOS and with following dependencies
>
> ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
> Rails 2.3.2
>
> Passenger Installed correctly after I restarted the apache by adding passenger configuration files paths in httpd.conf file but I get the following error message. Please look into this issue and update me what is the wrong in installation
>
> ========================================================
> /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44
>
> ==============================================================
> Looking for your responce
>
> Regards,
> Asif Shams
>
> Rediscover Hotmail®: Get quick friend updates right in your inbox.  Check it out.
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009

Asif Shams

unread,
Apr 8, 2009, 4:33:07 AM4/8/09
to phusion passenger
Hi Zac,

Thanks for your reply. I did installation of ruby using following instructions:

wget ftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz
tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
./configure && make && make install
source /etc/profile;ruby -v


rubygems are installed using following instructions:

echo 'export PATH=/usr/local/bin:$PATH' > /etc/profile.d/ruby.sh; source /etc/profile
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar -xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
export GEM_HOME=/usr/local/rubygems/gems; mkdir -p $GEM_HOME
ruby setup.rb all --prefix=/usr/local/rubygems
vi /etc/profile.d/rubygems.sh
contents of rubygems.sh are
export GEM_HOME=/usr/local/rubygems/gems
export GEM_PATH=/usr/local/rubygems/gems
export RUBYLIB=/usr/local/rubygems/lib
export PATH=/usr/local/rubygems/gems/bin:/usr/local/rubygems/bin:$PATH


Following is the output which you have asked me

whereis ruby
ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby

whereis gem
gem:
Feel free to communicate in case of more questions

Regards,
Asif Shams
----------------------------------------------------
> Date: Tue, 7 Apr 2009 22:19:06 -0700
> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
> From: isaac....@gmail.com
> To: phusion-...@googlegroups.com

isaac....@gmail.com

unread,
Apr 8, 2009, 9:22:14 PM4/8/09
to Phusion Passenger Discussions
Hi Asif,

From the 'whereis gem' output, the problem seems to be the system has
no idea where rubygems is installed. Anyway, just to make sure, did
you do a 'chmod +x /etc/profile.d/rubygems.sh' ? If you didn't then
that's the issue.

Cheers,

Zac

On Apr 8, 4:33 pm, Asif Shams <aasif_sh...@hotmail.com> wrote:
> Hi Zac,
>
> Thanks for your reply. I did installation of ruby using following instructions:
>
> wgetftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz
> tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
> ./configure && make && make install
> source /etc/profile;ruby -v
>
> rubygems are installed using following instructions:
>
> echo 'export PATH=/usr/local/bin:$PATH' > /etc/profile.d/ruby.sh; source /etc/profile
> wgethttp://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
> tar -xzvf rubygems-1.3.1.tgz
> cd rubygems-1.3.1
> export GEM_HOME=/usr/local/rubygems/gems; mkdir -p $GEM_HOME
> ruby setup.rb all --prefix=/usr/local/rubygems
> vi /etc/profile.d/rubygems.sh
> contents of rubygems.sh are
> export GEM_HOME=/usr/local/rubygems/gems
> export GEM_PATH=/usr/local/rubygems/gems
> export RUBYLIB=/usr/local/rubygems/lib
> export PATH=/usr/local/rubygems/gems/bin:/usr/local/rubygems/bin:$PATH
>
> Following is the output which you have asked me
>
> whereis ruby
> ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby
>
> whereis gem
> gem:
> Feel free to communicate in case of more questions
>
> Regards,
> Asif Shams
> ----------------------------------------------------
>
>
>
> > Date: Tue, 7 Apr 2009 22:19:06 -0700
> > Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load  -- rubygems (LoadError)
> > From: isaac.zach...@gmail.com

Asif Shams

unread,
Apr 9, 2009, 7:33:10 AM4/9/09
to phusion passenger
Hi,

I did the chmod +x /etc/profile.d/rubygems.sh file and started the apache server but I get the following error message in error_log file of apache

================================================================
[Thu Apr 09 04:51:39 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
/usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44
================================================================

Can you please send me the complete instruction how can I install mod_rails on CentOS (a new system)

Regards,
Asif Shams
----------------------------------------------------------------------
> Date: Wed, 8 Apr 2009 18:22:14 -0700

> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

Asif Shams

unread,
Apr 9, 2009, 12:18:24 PM4/9/09
to phusion passenger
Hi Zac,

I have reinstall all things including, ruby, rubygems, passenger and following are the out puts of command you asked me earlier

whereis ruby=  ruby: /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
whereis rubygems = rubygems: /usr/local/rubygems
whereis gem = gem: /usr/bin/gem

and I am getting following error message in error_log file of apache

=========================================================
[Thu Apr 09 07:39:21 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- fastthread (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:22

        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44
=========================================================

I think system is not loading rubygems path correctly again, as gems path is different from rubygems path. Can you please tell me how can I resolve this issue that both path should be the same or there is any other issue in this configuration

OR should I need to make a softlink between /usr/bin/gem and /usr/local/rubygems/bin/ directory so where gem is called it should be loaded from rubygems folder

Thanks in advance for your cooperation in this issue

Regards,
Asif Shams
Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
Date: Thu, 9 Apr 2009 04:33:10 -0700
> </html



Rediscover Hotmail®: Get e-mail storage that grows with you. Check it out.

isaac....@gmail.com

unread,
Apr 11, 2009, 2:39:10 PM4/11/09
to Phusion Passenger Discussions
Hi Asif,

Sorry for the late reply. It's holidays over here.

Anyway, you didn't need to reinstall anything. Another way to solve
your previous issue is by making a symlink of /usr/bin/gem to point
to /usr/local/rubygems/bin/gem. I just realised starting apache does
not load profile scripts so my previous solution was only good for
normal users.

Your latest problem seems to be a missing gem. Try doing a 'gem
install fastthread'.

Actually the path of rubygems is not important, as long as the system
knows where to find the gem command it will work. Also, I noticed your
passenger version is suddenlly an old version, 2.0.6. Please use the
latest version, 2.1.3.

Regards,
Zac

On Apr 10, 12:18 am, Asif Shams <aasif_sh...@hotmail.com> wrote:
> Hi Zac,
>
> I have reinstall all things including, ruby, rubygems, passenger and following are the out puts of command you asked me earlier
>
> whereis ruby=  ruby: /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
> whereis rubygems = rubygems: /usr/local/rubygems
> whereis gem = gem: /usr/bin/gem
>
> and I am getting following error message in error_log file of apache
>
> =========================================================
> [Thu Apr 09 07:39:21 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- fastthread (LoadError)
>         from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:22
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44
> =========================================================
>
> I think system is not loading rubygems path correctly again, as gems path is different from rubygems path. Can you please tell me how can I resolve this issue that both path should be the same or there is any other issue in this configuration
>
> OR should I need to make a softlink between /usr/bin/gem and /usr/local/rubygems/bin/ directory so where gem is called it should be loaded from rubygems folder
>
> Thanks in advance for your cooperation in this issue
>
> Regards,
> Asif Shams
> From: aasif_sh...@hotmail.com
> To: phusion-...@googlegroups.com
> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load  -- rubygems (LoadError)
> Date: Thu, 9 Apr 2009 04:33:10 -0700
>
> Hi,
>
> I did the chmod +x /etc/profile.d/rubygems.sh file and started the apache server but I get the following error message in error_log file of apache
>
> ================================================================
> [Thu Apr 09 04:51:39 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
> /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/utils.rb:19
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/abstract_server.rb:23
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/lib/passenger/spawn_manager.rb:19
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44:in `require'
>         from /usr/local/rubygems/gems/gems/passenger-2.0.6/bin/passenger-spawn-server:44
> ================================================================
>
> Can you please send me the complete instruction how can I install mod_rails on CentOS (a new system)
>
> Regards,
> Asif Shams
> ----------------------------------------------------------------------
>
>
>
> > Date: Wed, 8 Apr 2009 18:22:14 -0700
> > Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load  -- rubygems (LoadError)
> _________________________________________________________________
> Rediscover Hotmail®: Get e-mail storage that grows with you.http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Redisco...

Asif Shams

unread,
Apr 13, 2009, 12:08:30 PM4/13/09
to phusion passenger
Hi Zac,

I am getting the same error after I configured a soft link between /usr/bin/gem and  /usr/local/rubygems/bin/gem but I am getting the same error message in error_log file

==================================================================
[Sun Apr 12 23:46:14 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations

/usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/utils.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/abstract_server.rb:23
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/lib/phusion_passenger/spawn_manager.rb:19
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44:in `require'
        from /usr/local/rubygems/gems/gems/passenger-2.1.3/bin/passenger-spawn-server:44
==================================================================

I have tried following commands to see what gems installations are on my system:

# gem list --local

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
daemons (1.0.10)
fastthread (1.0.7)
passenger (2.1.3)
rails (2.2.2)
rake (0.8.4)
sqlite3-ruby (1.2.4)

It appeared from error message, apache is not loading rubems path as at line 19 in utils.rb files states
require 'rubygems'
require 'thread'
if (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
        require 'fastthread'

Please help me to, how can I load rubygems path in system environment or in apache startup

I will be very thanks full to you for your help. If u need any further datails, pls do let me know.I will be assisting you in this issue

Regards,
Asif Shams
-----------------------------------------------------------------------
> Date: Sat, 11 Apr 2009 11:39:10 -0700

> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

Hongli Lai

unread,
Apr 13, 2009, 12:39:29 PM4/13/09
to phusion-...@googlegroups.com
On Mon, Apr 13, 2009 at 6:08 PM, Asif Shams <aasif...@hotmail.com> wrote:
> Hi Zac,
>
> I am getting the same error after I configured a soft link between
> /usr/bin/gem and  /usr/local/rubygems/bin/gem but I am getting the same
> error message in error_log file

At this point I would recommend you to completely remove Ruby from
your system and reinstall it from scratch. All your current paths seem
to be totally wrong, and reinstalling everything seems easier.

You likely have multiple versions of Ruby installed, some which you
may not be aware of. You need to remove all of them and install only a
single version.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Asif Shams

unread,
Apr 13, 2009, 12:41:43 PM4/13/09
to phusion passenger
Hi,

Can you please do let me know how can I remove ruby from my system, do I just need to delete folders or need any thing more

Regards,
Asif Shams


> From: hon...@phusion.nl
> Date: Mon, 13 Apr 2009 18:39:29 +0200
> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

Hongli Lai

unread,
Apr 13, 2009, 1:40:26 PM4/13/09
to phusion-...@googlegroups.com
On Mon, Apr 13, 2009 at 6:41 PM, Asif Shams <aasif...@hotmail.com> wrote:
> Hi,
>
> Can you please do let me know how can I remove ruby from my system, do I
> just need to delete folders or need any thing more

That depends on how you installed Ruby in the past. If you installed
with Yum then you need to remove it with Yum. If you (also) installed
from source then you need to find out which files were installed to
where, and delete them. If you installed RubyGems to yet another
location then you need to locate those files as well, and delete them.

isaac....@gmail.com

unread,
Apr 17, 2009, 6:20:26 AM4/17/09
to Phusion Passenger Discussions
Hi Asif,

Sorry for the disappearance. Anyway, like Hongli mentioned, you need
to remove all traces of ruby & rubygem from your OS. If that is too
complicated or you OS is relatively fresh, you can consider doing a
fresh install & start over.

Once you have done that, give an update here. I'll guide you through.
I myself am running a few production servers with Ruby Enterprise
Edition together with Passenger & have no issues. So I'm sure I can
help you through this.

Regards,
Zac

On Apr 14, 1:40 am, Hongli Lai <hon...@phusion.nl> wrote:
> On Mon, Apr 13, 2009 at 6:41 PM, Asif Shams <aasif_sh...@hotmail.com> wrote:
> > Hi,
>
> > Can you please do let me know how can I remove ruby from my system, do I
> > just need to delete folders or need any thing more
>
> That depends on how you installed Ruby in the past. If you installed
> with Yum then you need to remove it with Yum. If you (also) installed
> from source then you need to find out which files were installed to
> where, and delete them. If you installed RubyGems to yet another
> location then you need to locate those files as well, and delete them.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl

Asif Shams

unread,
Apr 22, 2009, 10:15:51 AM4/22/09
to phusion passenger
Hi Zac,

I have tried on new installation of CentOS with following commands:

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-[latest].rpm
yum remove ruby
wget ftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz
tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
./configure && make && make install
source /etc/profile;ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
echo 'export PATH=/usr/local/bin:$PATH' > /etc/profile.d/ruby.sh; source /etc/profile
tar -xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
export GEM_HOME=/usr/local/rubygems/gems; mkdir -p $GEM_HOME
ruby setup.rb all --prefix=/usr/local/rubygems

vi /etc/profile.d/rubygems.sh

export GEM_HOME=/usr/local/rubygems/gems
export GEM_PATH=/usr/local/rubygems/gems
export RUBYLIB=/usr/local/rubygems/lib
export PATH=/usr/local/rubygems/gems/bin:/usr/local/rubygems/bin:$PATH

source /etc/profile

Now the gem installations
gem install --version '=2.2.2' actionmailer
gem install --version '=2.2.2' activeresource activesupport
gem install --version '=1.0.1' fastthread
gem install --version '=2.7' mysql -- --with-mysql-config
gem install --version '=2.0.6' passenger
gem install --version '=0.8.3' rake
gem install --version '=2.2.2' rails
gem install --version '=1.2.4' sqlite3-ruby
gem install --version '2.0.6' passenger
passenger-install-apache2-module

====================
These are the steps followed by our hosting company on Red Hat Linux server and we are using mod_rails successfully on that server
====================

But I am still getting the same error message which is already communicated to you, Can you please
provide me the steps of installation of mod_rails on new CentOS

Following are the output of whereis commands


whereis ruby
ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby

whereis rubygems
rubygems: /usr/local/rubygems

whereis gems
gems:

It appears that gems are not loaded into system, Can you send me a installation guide of passenger for CentOS on aasif...@hotmail.com

Regards,
Asif Shams
--------------------------------------------------------------------------

> Date: Fri, 17 Apr 2009 03:20:26 -0700

> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

isaac....@gmail.com

unread,
Apr 24, 2009, 12:14:29 AM4/24/09
to Phusion Passenger Discussions
Hi Asif,

Ok, I'll need you to do another fresh install of CentOS. After that
you can follow the following steps.

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2....
./configure --prefix=/usr && make && make install
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar -xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
ruby setup.rb

The biggest difference is that I do not make a script to load ruby
environment in /etc/profile & ruby is installed in /usr. I also do not
install rubygems to a custom directory. This seems to be the main
issue for you.

Now for the gems installation, please do NOT install custom versions
of the gems you require, unless you have VERY specific reasons, such
as only that version of the gem can work with your application.

So for gems installation, it can be simplified to just the following:

gem install rails
gem install fastthread
gem install mysql -- --with-mysql-config
gem install passenger
gem install sqlite3-ruby
passenger-install-apache2-module

This should work. I myself am using Ruby Enterprise Edition. The one
big benefit of using Ruby Enterprise Edition is that you do not have
to do much for installation. It auto installs ruby, rubygems & most of
the general gems needed. But its all in a self contained folder. So if
your system already have ruby, it won't interfere with it.

Good luck!

Regards,
Zac

On Apr 22, 10:15 pm, Asif Shams <aasif_sh...@hotmail.com> wrote:
> Hi Zac,
>
> I have tried on new installation of CentOS with following commands:
>
> rpm -Uvhhttp://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2....
> rpm -Uvhhttp://mirror.centos.org/centos/5/os/i386/CentOS/yum-[latest].rpm
> yum remove ruby
> wgetftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz
> tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
> ./configure && make && make install
> source /etc/profile;ruby -v
> ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
> echo 'export PATH=/usr/local/bin:$PATH' > /etc/profile.d/ruby.sh; source /etc/profile
> wgethttp://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
> It appears that gems are not loaded into system, Can you send me a installation guide of passenger for CentOS on aasif_sh...@hotmail.com
>
> Regards,
> Asif Shams
> --------------------------------------------------------------------------
>
>
>
> > Date: Fri, 17 Apr 2009 03:20:26 -0700
> > Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load  -- rubygems (LoadError)
> > From: isaac.zach...@gmail.com

Asif Shams

unread,
Apr 24, 2009, 11:11:32 AM4/24/09
to phusion passenger
Hi Zaac,

I tried the steps you mentioned in your reply but I am getting error message on following command


gem install mysql -- --with-mysql-config
-------------------------------------------------------------------------------
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install mysql -- --with-mysql-config
checking for mysql_ssl_set()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-mysql-config


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
----------------------------------------------------------------------------------

kindly look into this issue and do let me know what is the issue with this command

Regards,
Asif Shams

===================================================================
> Date: Thu, 23 Apr 2009 21:14:29 -0700

> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

isaac....@gmail.com

unread,
Apr 24, 2009, 10:52:37 PM4/24/09
to Phusion Passenger Discussions
Hi Asif,

Quick question, how did you install mysql? Is it already installed?
Actually I just copied that particular line from your steps as I
vaguely remember it to be something similiar. If you installed mysql
using yum, then all you need to do is this --> gem install mysql

If you compiled your own version of mysql, then it will be like this --
> -- --with-mysql-config=location_of_mysql_config

Replace location_of_mysql_config with full path to mysql_config.

If you do not use mysql, then there's no point installing this gem.

Regards,
Zac
> > From: isaac.zach...@gmail.com
> > To: phusion-...@googlegroups.com
>
> > Hi Asif,
>
> > Ok, I'll need you to do another fresh install of CentOS. After that
> > you can follow the following steps.
>
> > rpm -Uvhhttp://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2....
> > rpm -Uvhhttp://mirror.centos.org/centos/5/os/i386/CentOS/yum-[latest].rpm
> > yum remove ruby
> > wgetftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz
> > tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
> > ./configure --prefix=/usr && make && make install

Hongli Lai

unread,
Apr 25, 2009, 3:10:25 AM4/25/09
to phusion-...@googlegroups.com
On Sat, Apr 25, 2009 at 4:52 AM, isaac....@gmail.com
<isaac....@gmail.com> wrote:
>
> Hi Asif,
>
> Quick question, how did you install mysql? Is it already installed?
> Actually I just copied that particular line from your steps as I
> vaguely remember it to be something similiar. If you installed mysql
> using yum, then all you need to do is this --> gem install mysql

You also need to run 'yum install mysql-devel', for the development headers.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Asif Shams

unread,
Apr 26, 2009, 5:22:43 AM4/26/09
to phusion passenger
Hi,

I have not installed mysql, I am using by default version of mysql

Regards,
Asif Shams


> Date: Fri, 24 Apr 2009 19:52:37 -0700

> Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load -- rubygems (LoadError)

isaac....@gmail.com

unread,
Apr 26, 2009, 6:19:23 AM4/26/09
to Phusion Passenger Discussions
Hi Asif,

In that case just do a 'yum install mysql-devel' as Hongli mentioned
to be safe. Then 'gem install mysql'.

Is anything else failing? Also, please do try to create a new rails
test app, make sure you can start it with webrick, then try configure
passenger to point to that rails test app.

Regards,
Zac

On Apr 26, 5:22 pm, Asif Shams <aasif_sh...@hotmail.com> wrote:
> Hi,
>
> I have not installed mysql, I am using by default version of mysql
>
> Regards,
> Asif Shams
>
> > Date: Fri, 24 Apr 2009 19:52:37 -0700
> > Subject: [phusion-passenger] Re: phusion_passenger/utils.rb:19:in `require': no such file to load  -- rubygems (LoadError)
> ...
>
> read more »

Asif Shams

unread,
Sep 29, 2009, 11:53:10 AM9/29/09
to phusion passenger, isaac....@gmail.com
Hi Zaac / All,

I have installed ruby version 1.8.6 on a Red Hat Linux server (Production server). Then I have installed rubygems version 3.1 and 3.5 but I got following error message when I try to execute gem install rails command

Following are the steps I performed on my servers

yum remove ruby

Then I removed each ruby file on system after getting response by command
whereis ruby

wget ftp://ftp.ruby-lang.org:21/pub/ruby/1.8/ruby-1.8.6.tar.gz

tar xzvf ruby-1.8.6.tar.gz && cd ruby-1.8.6
./configure --prefix=/usr && make && make install

tar -xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
ruby setup.rb                   ##### All went correctly #############
gem install rails                 ##### Here the error comes #############

==========================================
[root@189423-web3 rubygems-1.3.5]# gem install
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- zlib (LoadError)

        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'

        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:11
         ... 11 levels...
        from /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in `process_args'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in `run'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
        from /usr/bin/gem:21
==========================================

Previously Mongrel was configured on this server I have uninstall all gems from this server by commands "gem uninstall gemname". Also I have removed the profile files for ruby and rubygems and rubygems folder. I have also removed the rubygems folder from /usr/local/rubygems (where rubygems were previously installed)
 
According to my understanding, this issue is due to environment paths, the system is still picking the old paths for zlib library, as this file exist at error location

Or is there any other solution to solve this problem. Can you please guide me

You can also send me the steps for installation of mod_rails on Linux. Thanks in advance

Regards,
Asif Shams

Insert movie times and more without leaving Hotmail®. See how.

Hongli Lai

unread,
Oct 2, 2009, 11:40:39 PM10/2/09
to phusion-...@googlegroups.com, isaac....@gmail.com

This error means that the zlib Ruby extension isn't installed. You
need to make sure that it's installed.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl

Reply all
Reply to author
Forward
0 new messages