2

After watch the Railscast "#347 Rubber and Amazon EC2", I'm trying to deploy a Rails app to Amazon ec2, after solve some previous problems, I'm stuck at this error:

  * 2014-01-19 10:14:04 executing `rubber:apache:start'
  * executing "sudo -p 'sudo password: '  bash -l -c 'service apache2 status || service apache2 start'"
    servers: ["production.foo.com"]
    [production.foo.com] executing command
 ** [out :: production.foo.com] Apache2 is NOT running.
 ** [out :: production.foo.com] * Starting web server apache2
 apache2: Syntax error on line 211 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/passenger.conf: Cannot load /usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0.0/gems/passenger-4.0.35/ext/apache2/mod_passenger.so into server: /usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0.0/gems/passenger-4.0.35/ext/apache2/mod_passenger.so: cannot open shared object file: No such file or directory
 ** [out :: production.foo.com] Action 'start' failed.

My remote apache2.conf

   208  #...
   209  # Include module configuration:
   210  Include mods-enabled/*.load
   211  Include mods-enabled/*.conf
   212  #...

My remote /usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0.0/gems/passenger-4.0.35

 2  LoadModule passenger_module /usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0.0/gems/passenger-4.0.35/ext/apache2/mod_passenger.so
 3  PassengerRoot /usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0.0/gems/passenger-4.0.35
 4  PassengerRuby /usr/local/rubies/2.0.0-p247/bin/ruby
 5  PassengerUseGlobalQueue on
 6 #...

My Gemfile:

#...
# Rubber deploy
gem 'rubber'
gem 'open4'
gem 'gelf'
gem 'graylog2_exceptions', :git => 'git://github.com/wr0ngway/graylog2_exceptions.git'
gem 'graylog2-resque'
gem 'unf'
gem "passenger", "~> 4.0.35"

My rubber-passenger.yml

passenger_version: 4.0.35
passenger_root: "#{`bash -l -c 'find #{ruby_path} -name passenger-#{passenger_version}'`.strip}"
passenger_ruby: "#{ruby_path}/bin/ruby"
passenger_lib: "#{passenger_root}/ext/apache2/mod_passenger.so"
passenger_listen_port: 7000
passenger_listen_ssl_port: 7001
max_app_connections: 20

role_dependencies:
  passenger: [apache]

roles:
  passenger:
    packages: [apache2-mpm-prefork, apache2-prefork-dev, libcurl4-openssl-dev, libapache2-mod-xsendfile]
    gems: [fastthread, rack, [passenger, "#{passenger_version}"]]
    rolling_restart_port: "#{passenger_listen_port}"

  web_tools:
    rolling_restart_port: "#{web_tools_port}"

My rubber-ruby.yml

ruby_build_version: 20131220.1
ruby_version: 2.0.0-p247
ruby_path: "/usr/local/rubies/#{ruby_version}"

Any help? Thks!

Rico
  • 58,485
  • 12
  • 111
  • 141
DoctorRu
  • 1,063
  • 1
  • 13
  • 15

1 Answers1

3

Looks like you are missing the passenger module for apache.

Have you tried on Ubuntu:

sudo apt-get install libapache2-mod-passenger

or on CentOS:

yum install mod_passenger

or just general installation

gem install passenger
Rico
  • 58,485
  • 12
  • 111
  • 141
  • After look around I found it: "In the RC 2 announcement we merely claimed that we encountered a lot of bugs (for example this one) in Ruby 2.0.0 itself, and that we therefore would not recommend using Ruby 2.0.0 yet. These bugs have got nothing to do with Phusion Passenger. Phusion Passenger supports Ruby 2.0.0 regardless of what bugs Ruby 2.0.0 has." http://blog.phusion.nl/2013/06/06/phusion-passenger-does-support-ruby-2-0/ So I went back to Ruby 1.9.3 and everything is working fine. – DoctorRu Jan 21 '14 at 14:16