部署 部署完成后访问出现:We're sorry, but something went wrong

xautjzd · 2014年04月21日 · 最后由 xautjzd 回复于 2014年04月21日 · 13493 次阅读

背景 开始在 CentOS 下部署,最终还是没法成功,便把环境切换到到 Ubuntu12.04 LTS 64 位,开始使用 root 安装 RVM,Ruby 等环境,但是发现每次切换到一般用户下还是无法找到 Ruby,即使将相应脚本添加到~/.bashrc 下也不行。最后还是切换到一般用户下进行。部署完成后,访问出现 403 ForBidden,但是最后将/etc/nginx/nginx.conf 下的 user 改成了与 Rails app 目录一样的用户就顺利解决。

问题 ForBidden 问题解决后,但是再次访问便出现:

We're sorry, but something went wrong
If you are the application owner check the logs for more information

查看 error.log 文件后还是没看明白到底怎么回事,error.log 文件信息如下:

error.log

2014/04/21 09:58:48 [info] 573#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:74
[ 2014-04-21 09:58:48.3969 574/7f34ede5c740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '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.41', '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.41', 'web_server_pid' => '573', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '1001', 'web_server_worker_uid' => '1000' }
[ 2014-04-21 09:58:48.4022 577/7fce99aab740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.573/generation-0/request
[ 2014-04-21 09:58:48.4119 582/7fcbcd884740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.573/generation-0/logging
[ 2014-04-21 09:58:48.4153 574/7f34ede5c740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-04-21 09:58:48.4267 582/7fcbcd884740 agents/LoggingAgent/Main.cpp:289 ]: Caught signal, exiting...
[ 2014-04-21 09:58:49.4683 620/7f4c97015740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '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.41', '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.41', 'web_server_pid' => '619', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '1001', 'web_server_worker_uid' => '1000' }
[ 2014-04-21 09:58:49.4738 623/7fd1e0cab740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.619/generation-0/request
[ 2014-04-21 09:58:49.4829 628/7fd04aabf740 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.619/generation-0/logging
[ 2014-04-21 09:58:49.4898 620/7f4c97015740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
App 657 stdout:
App 657 stderr: Instance method "open" is already defined in Object, use generic helper instead or set StateMachine::Machine.ignore_method_conflicts = true.
App 657 stderr:
[ 2014-04-21 09:59:05.3109 623/7fd1e0bb3700 Pool2/SmartSpawner.h:301 ]: Preloader for /var/www/bebety.com/current started on PID 657, listening on unix:/tmp/passenger.1.0.619/generation-0/backends/preloader.657
App 806 stdout:

应用内错误,检查项目文件夹下的 log/production.log

573#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:74 显然是使用的内存超过了 nginx.conf 中的配置

#1 楼 @Rei #2 楼 @bydmm 谢谢。看/log/production.log,貌似是我数据库设置的问题。如果数据库设置对了,再出现这个问题,那么可能就是内存的原因了,目前正在进行。谢谢二位

需要 登录 后方可回复, 如果你还没有账号请 注册新账号