带有Passenger4.0.53 / nginx(通过乘客安装)和postgresql 9.3.5数据库的rails3应用程序正在运行...部分!
根据rails应用程序控制器调用主页URL呈现页面=> home,action =>索引。
但是点击登录链接,正在生成正确的URL,但结果是404错误。重启乘客,然后ngingx未能改变行为......
/ etc / nginx / sites-enabled / default设置如下:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name ranz2.iwant2go2.com;
passenger_enabled on;
rails_env development;
root /home/deploy/ranz/current/public;
# location / {
# try_files $uri $uri/ =404;
# passenger_enabled on;
# }
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
nginx错误日志
[ 2014-10-14 07:42:57.7851 24433/7f42e3109780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.53', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.53', 'web_server_pid' => '24432', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-10-14 07:42:57.8090 24436/7f55db281780 agents/HelperAgent/Main.cpp:650 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.24432/generation-0/request
[ 2014-10-14 07:42:57.8705 24441/7fbfd457b7c0 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.24432/generation-0/logging
[ 2014-10-14 07:42:57.8715 24433/7f42e3109780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-10-14 07:42:57.8865 24441/7fbfd457b7c0 agents/LoggingAgent/Main.cpp:289 ]: Caught signal, exiting...
更新查看其他类似问题,我已禁用' passenger_enabled;'第一个位置块内的指令。重新启动nginx和应用程序。行为没有变化。随后我禁用第一个位置块...重新启动nginx和应用程序。行为没有变化。
我错过了什么?
答案 0 :(得分:0)
问题出在nginx.conf中。我的理解是,passenger_ruby应指向which ruby
的结果,这就是我切换到的结果:
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
# passenger_ruby /usr/bin/ruby;
passenger_ruby /home/deploy/.rvm/rubies/ruby-1.9.3-p547/bin/ruby;
然而, RTFM 会返回乘客错误。谁的内容指向一个正确的方向(好的' ya Phusion!)。手册,部分" 8.3.1。 passenger_ruby"是明确的。
which passenger-config
将结果粘贴到后续命令
rvm use <desired_version>
<result_of_which passenger_config> --ruby-command
然后从输出字符串中得到字符串来定义nginx.conf中的passenger_ruby,它应该重新组合像
/home/deploy/.rvm/gems/ruby-1.9.3-p547/wrappers/ruby