2

在觀看Railscast「#347橡膠和亞馬遜EC2」後,我試圖部署一個Rails應用程序到亞馬遜EC2,解決了一些以前的問題,我被困在這個錯誤:Rails部署到EC2與橡膠:mod_passenger.so:無法打開共享目標文件

* 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. 

我的遙控apache2.conf

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

我的遙控/usr/local/rubies/2.0.0-p247/lib/ruby/gems/2.0 .0 /寶石/人 - 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 #... 

我的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" 

我的橡膠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}" 

我的橡膠ruby.yml

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

任何幫助嗎? THKS!

回答

3

看起來你缺少apache的乘客模塊。

您是否嘗試過在Ubuntu:

sudo apt-get install libapache2-mod-passenger 

或在CentOS:

yum install mod_passenger 

或只是一般安裝

gem install passenger 
+0

後,我環顧四周發現: 「在RC 2聲明我們只聲稱我們在Ruby中遇到了很多錯誤(例如這一個) 2.0.0本身,因此我們不推薦使用Ruby 2.0.0。這些bug與Phusion Passenger沒有任何關係。無論Ruby 2.0.0有哪些錯誤,Phusion Passenger都支持Ruby 2.0.0。「 http://blog.phusion.nl/2013/06/06/phusion-passenger-does-support-ruby-2-0/ 所以我回到了Ruby 1.9.3,一切工作正常。 – DoctorRu

相關問題