Deploying to a machine without a compiler etc. etc.

1,313 views
Skip to first unread message

Ben Timby

unread,
Oct 18, 2010, 12:57:42 PM10/18/10
to phusion-...@googlegroups.com
I am deploying a rails application onto a web server machine. My
security policies prevent the installation of any compilers, headers
etc onto this machine. Therefore I am building passenger and nginx as
RPM packages to be deployed onto this machine.

However, when I try to test the installation by running the passenger
tools, I receive the following.

--
# /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/bin/passenger-status
*** Phusion Passenger: no passenger_native_support.so found for the
current Ruby interpreter. Compiling one...
# mkdir -p /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/ruby/ruby-1.8.7-x86_64-linux
# cd /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/ruby/ruby-1.8.7-x86_64-linux
# /usr/bin/ruby
'/usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/ruby/extconf.rb'
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
/usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:127:in
`sh': Could not compile passenger_native_support.so ('/usr/bin/ruby
'/usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/ruby/extconf.rb''
failed) (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:140:in
`compile'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:139:in
`chdir'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:139:in
`compile'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`each_with_index'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:133:in
`each'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:133:in
`each_with_index'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:133:in
`compile'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:111:in
`compile_and_load'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:36:in
`start'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/native_support.rb:166
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/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/utils.rb:37
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/message_client.rb:27:in
`require'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/message_client.rb:27
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/admin_tools/server_instance.rb:30:in
`require'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/admin_tools/server_instance.rb:30
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/bin/passenger-status:29:in
`require'
from /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/bin/passenger-status:29
--

This is because I am missing the ruby-devel package. If I install
this, then I am missing make. And so on and so forth.

How can I ensure that all of this stuff is built on my packaging
machine and present when I deploy?

Hongli Lai

unread,
Oct 18, 2010, 2:10:58 PM10/18/10
to phusion-...@googlegroups.com

You need to put passenger_native_support.so in your RPM as well. Try
'rake fakeroot', that'll create an FHS-compliant directory tree that
you can package directly.

But we're actually working with packagers to provide an RPM/YUM
repository in the near future.

--
Phusion | The Computer Science Company

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

Ben Timby

unread,
Oct 18, 2010, 3:50:45 PM10/18/10
to phusion-...@googlegroups.com
On Mon, Oct 18, 2010 at 2:10 PM, Hongli Lai <hon...@phusion.nl> wrote:
> You need to put passenger_native_support.so in your RPM as well. Try
> 'rake fakeroot', that'll create an FHS-compliant directory tree that
> you can package directly.

Trying that yields:

--
# rake fakeroot
(in /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0)
gcc -Iext -Iext/common -fPIC -fvisibility=hidden
-DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -D_REENTRANT
-I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx"
-DHASH_FUN_H="<ext/hash_fun.h>" -Wall -g -DPASSENGER_DEBUG
-DBOOST_DISABLE_ASSERTS -o ext/apache2/mod_passenger.o -c
ext/apache2/mod_passenger.c
ext/apache2/mod_passenger.c:25:19: error: httpd.h: No such file or directory
ext/apache2/mod_passenger.c:26:25: error: http_config.h: No such file
or directory
In file included from ext/apache2/mod_passenger.c:27:
ext/apache2/Configuration.h:28:23: error: apr_pools.h: No such file or directory
In file included from ext/apache2/mod_passenger.c:27:
ext/apache2/Configuration.h:38: error: expected ‘)’ before ‘*’ token
ext/apache2/Configuration.h:41: error: expected ‘)’ before ‘*’ token
ext/apache2/Configuration.h:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘passenger_commands’
In file included from ext/apache2/mod_passenger.c:28:
ext/apache2/Hooks.h:39: error: expected ‘)’ before ‘*’ token
ext/apache2/mod_passenger.c:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘AP_MODULE_DECLARE_DATA’
rake aborted!
Command failed with status (1): [gcc -Iext -Iext/common -fPIC -fvisibility=...]

(See full trace by running task with --trace)
--

I don't have httpd or httpd-devel installed since I am using nginx.
How can I build the components I need and skip those I don't?

> But we're actually working with packagers to provide an RPM/YUM
> repository in the near future.

Great, any timeline? I need this deployed yesterday, so I likely must
forge ahead on my own for now.

Hongli Lai

unread,
Nov 1, 2010, 11:35:57 AM11/1/10
to phusion-...@googlegroups.com
On Mon, Oct 18, 2010 at 9:50 PM, Ben Timby <bti...@gmail.com> wrote:
> I don't have httpd or httpd-devel installed since I am using nginx.
> How can I build the components I need and skip those I don't?

Right now you can't, the fakeroot task is designed for packagers who
need to package everything. The next best thing I can advise you to do
is to install all development dependencies on your build box but only
package those binaries that you actually need, i.e. everything except
the Apache module.

> Great, any timeline? I need this deployed yesterday, so I likely must
> forge ahead on my own for now.

It should be available for public testing soon.

Reply all
Reply to author
Forward
0 new messages