我正在尝试在Apache2上运行rails应用程序。在浏览器上查看站点时,它列出了目录中的所有文件,而不是运行应用程序。 Apache的错误日志显示消息
[Fri Nov 20 15:15:04.274304 2015] [mpm_event:notice] [pid 7656:tid 139998747531136] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.21 configured -- resuming normal operations
[Fri Nov 20 15:15:04.274334 2015] [core:notice] [pid 7656:tid 139998747531136] AH00094: Command line: '/usr/sbin/apache2'
CONF:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /home/adminuser/hroot>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<VirtualHost *:80>
ServerName www.hroot.ncl.ac.uk
# Tell Apache and Passenger where your app's 'public' directory is
DocumentRoot /home/adminuser/hroot/
PassengerRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
# Relax Apache security settings
<Directory /home/adminuser/hroot>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache > 2.4:
Require all granted
</Directory>
</VirtualHost>
我现在在日志文件中收到此消息。
App 11778 stderr: Trying next mirror...
App 11778 stderr: Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.21/rubyext-ruby-2.1.2-x86_64-linux.tar.gz: The requested URL returned error: 403 Forbidden
App 11778 stderr: --> Continuing without passenger_native_support.so.
App 11778 stdout:
[ 2015-11-24 13:04:47.5518 11693/7fdca9f4e700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: eee6139e
Error details saved to: /tmp/passenger-error-EzX9GD.html
Message from application: cannot load such file -- bundler/setup (LoadError)
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
尝试链接后,您建议我收到此错误消息:
[2015-11-24 14:50:58.1887 15008 / 7efc7eab5700 age / Cor / App / Implementation.cpp:304]:无法为application / hroot / hroot生成进程:启动预加载器时出错。
错误ID:d5e32def
错误详细信息保存到:/tmp/passenger-error-33KRJ9.html
来自应用程序的消息:/hroot/hroot/config/application.rb:23:无效的多字节字符(US-ASCII)
/hroot/hroot/config/application.rb:23:无效的多字节字符(US-ASCII)
/hroot/hroot/config/application.rb:23:语法错误,意外$ end,期待'}'
......'Deutsch(de)',:fr =&gt; 'Français(fr)'}
... ^(SyntaxError)
/hroot/hroot/config/environment.rb:2:in require'
/hroot/hroot/config/environment.rb:2:in
'
config.ru:3:in require'
config.ru:3:in
阻止'
/var/lib/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval'
/var/lib/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize'
config.ru:1:in new'
config.ru:1:in
'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:110:in
preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:156:in <module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in
'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in`'