Rails server return “404 Not Found” after user log

2019-08-20 04:19发布

问题:

Our rails 3.2.12 app is running on ubuntu 12.04 passenger/nginx server. It has been verified that both nginx and passenger are running fine. However after user login, there is 404 Not Found page thrown out. The the page is redirected to session instead of user menu. Here is the production log for a login (the app is running fine with the rails server locally):

Started GET "/nbhy" for 73.15.38.185 at 2013-05-04 20:50:55 +0000
Processing by Authentify::SessionsController#new as HTML
  Rendered /home/ubuntu/.bundler/ruby/2.0.0/authentify-ac308b622f90/app/views/authentify/sessions/new.html.erb within layouts/sessions (3.0ms)
Completed 200 OK in 12ms (Views: 7.8ms | ActiveRecord: 0.6ms)

The rails app logs shows that the user has been authorized successfully. Somehow the page was redirected to session instead of user menu as it should be. We did rake assets:precompile and it did not help. What could cause the error? Thanks for the help.

UPDATE:

Here is the output under .rvm/.../bundler. What we notice is that the gem authentify installed on 5/5 seems have less right than the one installed on 5/2. Is the less right on authentify the cause of the 404 page?

Also in production it is ruby 2.0.0 and it is ruby 1.9.3 in development.

ubuntu@ip-10-132-194-74:~/.rvm/gems/ruby-2.0.0-p0/bundler/gems$ ls -l
total 16
drwxrwsr-x 10 ubuntu rvm 4096 May  2 04:09 authentify-784b2b097685
drwxr-xr-x 10 ubuntu rvm 4096 May  5 04:15 authentify-408e81eb022f
drwxrwsr-x 10 ubuntu rvm 4096 May  4 04:15 customerx-e1f88de5dc18
drwxrwsr-x 10 ubuntu rvm 4096 May  2 04:07 projectx-225464da5d6f
drwxr-xr-x 10 ubuntu rvm 4096 May  4 04:15 projectx-408e81ebe12b