gpt4 book ai didi

ruby-on-rails-3 - Ubuntu - Apache - Rails - 乘客 - 生成错误

转载 作者:行者123 更新时间:2023-12-04 19:22:00 25 4
gpt4 key购买 nike

我有乘客提示的错误:

*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /usr/local/rvm/gems/ruby-1.9.3-head/ruby: No such file or directory (2)
[ pid=8970 thr=139698295748416 file=ext/apache2/Hooks.cpp:865 time=2012-11-07 17:17:32.422 ]: Unexpected error in mod_passenger: Cannot spawn application '/www/lensfinder.se/ruby/lensfinder': Could not read from the spawn server: Connection reset by peer (104)
Backtrace:
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750)
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:297)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566)

据我所知,它无法访问/www/lensfinder.se/ruby/lensfinder 尽管它存在。

我在 Phusion Passengers site 上找到了这个常见问题解答

问题是,当我尝试使用该命令时,
passenger-config --root

我明白了:
-bash: /usr/bin/passenger-config: ruby: bad interpreter: No such file or directory

Apache 配置:
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-head/ruby

<VirtualHost 10.0.0.37:80>
ServerAdmin webmaster@compartment.se
DocumentRoot /www/lensfinder.se/htdocs
ServerName lensfinder.se
Redirect 301 / http://www.lensfinder.se/
ErrorLog /var/log/apache2/lensfinder.se-error.log
CustomLog /var/log/apache2/lensfinder.se-access.log combined
</VirtualHost>
<VirtualHost 10.0.0.37:80>
ServerAdmin hostmaster@compartment.se
ServerName lensfinder.se
ServerAlias www.lensfinder.se
ServerAlias *.lensfinder.se
# DocumentRoot /www/lensfinder.se/htdocs
DocumentRoot /www/lensfinder.se/ruby/lensfinder/script
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /www/lensfinder.se/htdocs>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /www/lensfinder.se/cgi-bin/
<Directory "/www/lensfinder.se/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AllowOverride AuthConfig
#Options Includes
#Options FollowSymLinks
#Options +Indexes +Multiviews +FollowSymLinks
</Directory>
<Directory "/www/lensfinder.se/htdocs/usage">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AllowOverride AuthConfig
#Options Includes
#Options FollowSymLinks
#Options +Indexes +Multiviews +FollowSymLinks
</Directory>
ErrorLog /var/log/apache2/lensfinder.se-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/lensfinder.se-access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>


Alias /ruby/ /www/lensfinder.se/ruby/lensfinder/script
<Directory /www/lensfinder.se/ruby/lensfinder/script>
# Options ExecCGI
# AddHandler cgi-script .cgi
# Addhandler fastcgi-script .fcgi .fcg .fpl
AllowOVerride all
Order allow,deny
Allow from all
</Directory>

<IfModule passenger_module>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/gems/ruby-1.9.3-head/ruby
</IfModule>

RailsEnv production
RailsBaseURI /script



#
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary
</Location>

</VirtualHost>

最佳答案

好的,我的猜测是您将Passenger 指向错误的目录。您应该将其指向 public Rails 应用程序的目录。

这是您项目的极简配置,位于 /etc/apache2/sites-available/lensfinder.se :

<VirtualHost 10.0.0.37:80>
ServerAdmin hostmaster@compartment.se
ServerName lensfinder.se
ServerAlias *.lensfinder.se

DocumentRoot /www/lensfinder.se/ruby/lensfinder/public
RailsEnv production

<Directory "/www/lensfinder.se/ruby/lensfinder/public">
Options FollowSymLinks
AllowOverride All
Options -MultiViews
</Directory>

</VirtualHost>

然后编辑 /etc/apache2/apache2.conf并在文件末尾添加:
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-head/gems/passenger-3.0.12
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-head/ruby

然后 simlink 您的虚拟主机配置以启用它:
ln -s /etc/apache2/sites-available/lensfinder.se /etc/apache2/sites-enabled/lensfinder.se 

当然重启apache2

关于ruby-on-rails-3 - Ubuntu - Apache - Rails - 乘客 - 生成错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13273952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com