2015-04-01 26 views
0

我最近在軌道上安裝Catarse一個Ruby on Heroku基於應用程序,它可以在這裏訪問App Link如何解決的Ruby on在Heroku上的Rails應用程序不能登錄並重定向到主頁

我是新來的Heroku和紅寶石,所以我可以得到的任何幫助將是偉大的。我遇到的問題是部署應用後我無法登錄。輸入用戶名/電子郵件和密碼,然後登錄按鈕被點擊,然後我被重定向到主頁,沒有任何警告或錯誤。

如何確定爲什麼我無法在heroku上登錄應用程序並將其重定向到主頁?

用戶是用下面的創建:

$ admin = User.new({ 
    name: 'my-admin-name', 
    email: '[email protected]', 
    password: 'my-admin-password', 
    password_confirmation: 'my-admin-password' 
}) 

$ admin.save 

如果我嘗試使用註冊頁面我將與「電子郵件已經採取」提示在同一個郵箱註冊,因此該帳戶存在。我只是無法登錄

這裏是我的日誌:

\pure-depths-2749>heroku logs 
2015-03-31T23:36:41.425513+00:00 app[web.1]: Warning. Error encountered while sa 
ving cache bdca0af185630201ca4675edc62168d03c57e893/_webflow.scssc: can't dump a 
nonymous class #<Class:0x007f9435a6e2a0> 
2015-03-31T23:36:41.425538+00:00 app[web.1]: 
2015-03-31T23:36:43.945059+00:00 heroku[web.1]: Process running mem=514M(100.5%) 

2015-03-31T23:36:43.945059+00:00 heroku[web.1]: Error R14 (Memory quota exceeded 
) 
2015-03-31T23:36:46.482422+00:00 app[web.1]: Warning. Error encountered while sa 
ving cache bdca0af185630201ca4675edc62168d03c57e893/_main.scssc: can't dump anon 
ymous class #<Class:0x007f9435a6e2a0> 
2015-03-31T23:36:46.482428+00:00 app[web.1]: 
2015-03-31T23:36:46.976023+00:00 app[web.1]: Warning. Error encountered while sa 
ving cache bdca0af185630201ca4675edc62168d03c57e893/_extra.sassc: can't dump ano 
nymous class #<Class:0x007f9435a6e2a0> 
2015-03-31T23:36:46.976029+00:00 app[web.1]: 
2015-03-31T23:36:47.213762+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_new_zendesk.html.slim (77.0ms) 
2015-03-31T23:36:47.266743+00:00 app[web.1]: Rendered layouts/_facebook_sdk.ht 
ml.slim (51.5ms) 
2015-03-31T23:36:47.365160+00:00 app[web.1]: Rendered layouts/_crazzy_egg.html 
.slim (43.9ms) 
2015-03-31T23:36:47.475772+00:00 app[web.1]: Rendered layouts/_mixpanel.html.s 
lim (29.5ms) 
2015-03-31T23:36:47.300936+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_webfont.html.slim (33.1ms) 
2015-03-31T23:36:47.476412+00:00 app[web.1]: Completed 404 Not Found in 19361ms 
(Views: 19167.3ms | ActiveRecord: 80.2ms) 
2015-03-31T23:36:47.415963+00:00 app[web.1]: Rendered layouts/_analytics.html. 
slim (49.3ms) 
2015-03-31T23:36:47.491336+00:00 heroku[router]: sock=client at=error code=H18 d 
esc="Request Interrupted" method=GET path="/en/password" host=pure-depths-2749.h 
erokuapp.com request_id=3f99b7bd-3e6d-4c9b-a543-50a6869dfed7 fwd="140.216.561.79 
" dyno=web.1 connect=1ms service=20034ms status=503 bytes=887 
2015-03-31T23:36:57.341447+00:00 heroku[router]: at=error code=H12 desc="Request 
timeout" method=GET path="/en/projects" host=pure-depths-2749.herokuapp.com req 
uest_id=6d0ffcd9-851d-4735-b22e-893fe4df0d9f fwd="140.216.561.79" dyno=web.1 con 
nect=0ms service=30004ms status=503 bytes=0 
2015-03-31T23:36:59.165824+00:00 app[web.1]: E, [2015-03-31T23:36:59.115504 #3] 
ERROR -- : worker=0 PID:7 timeout (31s > 30s), killing 
2015-03-31T23:36:59.435932+00:00 app[web.1]: E, [2015-03-31T23:36:59.435793 #3] 
ERROR -- : reaped #<Process::Status: pid 7 SIGKILL (signal 9)> worker=0 
2015-03-31T23:37:04.077839+00:00 app[web.1]: I, [2015-03-31T23:37:04.077503 #26] 
    INFO -- : worker=0 ready 
2015-03-31T23:37:10.765051+00:00 app[web.1]: Started GET "/en/" for 190.213.201. 
61 at 2015-03-31 23:37:10 +0000 
2015-03-31T23:37:18.274014+00:00 app[web.1]: Processing by ProjectsController#in 
dex as HTML 
2015-03-31T23:37:18.274112+00:00 app[web.1]: Parameters: {"locale"=>"en"} 
2015-03-31T23:37:19.356565+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_header.html.slim (53.2ms) 
2015-03-31T23:37:19.356618+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_header_big.html.slim (382.3ms) 
2015-03-31T23:37:19.402549+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-03-31T23:37:19.419278+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-03-31T23:37:19.556334+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_about.html.slim (40.6ms) 
2015-03-31T23:37:19.408945+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-03-31T23:37:19.623912+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_newsletter.html.slim (23.8ms) 
2015-03-31T23:37:19.599052+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_navigate.html.slim (41.8ms) 
2015-03-31T23:37:19.514571+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_welcome.html.slim (35.4ms) 
2015-03-31T23:37:19.698225+00:00 heroku[router]: at=info method=GET path="/en/" 
host=pure-depths-2749.herokuapp.com request_id=3e6d7f2f-bfcd-4738-bf54-415c48fbc 
0c4 fwd="140.216.561.79" dyno=web.1 connect=1ms service=9693ms status=200 bytes= 
5293 
2015-03-31T23:37:19.666087+00:00 app[web.1]: Rendered layouts/_facebook_like.h 
tml.slim (40.8ms) 
2015-03-31T23:37:19.683414+00:00 app[web.1]: Rendered layouts/_mixpanel.html.s 
lim (0.1ms) 
2015-03-31T23:37:19.682594+00:00 app[web.1]: Rendered layouts/_crazzy_egg.html 
.slim (0.0ms) 
2015-03-31T23:37:19.681929+00:00 app[web.1]: Rendered layouts/_facebook_sdk.ht 
ml.slim (0.1ms) 
2015-03-31T23:37:19.679554+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_new_zendesk.html.slim (0.2ms) 
2015-03-31T23:37:19.667086+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_big.html.slim (223.6ms) 
2015-03-31T23:37:19.683079+00:00 app[web.1]: Rendered layouts/_analytics.html. 
slim (0.2ms) 
2015-03-31T23:37:19.696467+00:00 app[web.1]: Completed 200 OK in 1410ms (Views: 
1212.2ms | ActiveRecord: 27.8ms) 
2015-03-31T23:37:19.667163+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/index.html.slim within layouts/catarse_bootstrap (1165.5ms) 
2015-03-31T23:37:19.682164+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_webfont.html.slim (0.0ms) 
2015-03-31T23:37:26.892033+00:00 app[web.1]: Started GET "/assets/catarse_bootst 
rap/catarse-968ad7d0e8e4d26f16c27dc5a9825688.css" for 140.216.561.79 at 2015-03- 
31 23:37:26 +0000 
2015-03-31T23:37:28.706465+00:00 app[web.1]: ** [NewRelic][03/31/15 23:37:28 +00 
00 web.1 (26)] INFO : Reporting to: https://rpm.newrelic.com/accounts/942472/app 
lications/7592593 
2015-03-31T23:37:33.275407+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/catarse-968ad7d0e8e4d26f16c27dc5a9825688.css" host=pure-dept 
hs-2749.herokuapp.com request_id=b135f98f-45bd-4043-a82d-5349064802ca fwd="190.2 
13.201.61" dyno=web.1 connect=0ms service=12594ms status=200 bytes=19713 
2015-03-31T23:37:33.726262+00:00 heroku[router]: at=info method=GET path="/asset 
s/logo-footer-00a039e0442e9aa77f91154e110532f8.png" host=pure-depths-2749.heroku 
app.com request_id=76dca22c-e129-4e62-8db2-ac50ffc1518a fwd="140.216.561.79" dyn 
o=web.1 connect=0ms service=5ms status=200 bytes=3717 
2015-03-31T23:37:33.719247+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/lupa-4c40ac88a951042d4320c89588a4d766.png" host=pure-depths- 
2749.herokuapp.com request_id=0aa4c9b8-9231-4235-8526-645873e96e43 fwd="190.213. 
201.61" dyno=web.1 connect=1ms service=5ms status=200 bytes=1472 
2015-03-31T23:37:33.724483+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/loader-5d70369784c2cebed69affb92554cd6b.gif" host=pure-depth 
s-2749.herokuapp.com request_id=81c7bd5c-b50c-48d6-a600-0ab2e8ec071c fwd="140.216.561.79" dyno=web.1 connect=1ms service=4ms status=200 bytes=51305 
2015-03-31T23:37:33.702919+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/icon-newsletter-3dbf29691958df54e9bf012f6e81553c.png" host=p 
ure-depths-2749.herokuapp.com request_id=2a536b61-e5a4-4b24-8fb1-b658d5870bf6 fw 
d="140.216.561.79" dyno=web.1 connect=0ms service=2ms status=200 bytes=439 
2015-03-31T23:37:33.706281+00:00 heroku[router]: at=info method=GET path="/asset 
s/icon-blog-cbf858f1a5578442d48b02dd95e74516.png" host=pure-depths-2749.herokuap 
p.com request_id=d058758d-fbbb-40bf-9059-4f24f2df738e fwd="140.216.561.79" dyno= 
web.1 connect=0ms service=9ms status=200 bytes=3843 
2015-03-31T23:37:34.035187+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/logo_big-0513a67968a6c77bf3e5373c8e413ae3.png" host=pure-dep 
ths-2749.herokuapp.com request_id=1a069451-f22a-4653-aff3-1ec402a30620 fwd="190. 
213.201.61" dyno=web.1 connect=1ms service=338ms status=200 bytes=7300 
2015-03-31T23:37:35.190677+00:00 heroku[router]: at=info method=GET path="/asset 
s/hero-home.jpg" host=pure-depths-2749.herokuapp.com request_id=c5fda42f-97f2-4e 
a2-8c48-60c2cc637a7c fwd="140.216.561.79" dyno=web.1 connect=2ms service=16ms st 
atus=200 bytes=93182 
2015-03-31T23:37:35.190597+00:00 app[web.1]: Started GET "/assets/hero-home.jpg" 
for 140.216.561.79 at 2015-03-31 23:37:35 +0000 
2015-04-01T00:07:32.238093+00:00 app[web.1]: Started GET "/en/login" for 190.213 
.201.61 at 2015-04-01 00:07:32 +0000 
2015-04-01T00:07:32.248833+00:00 app[web.1]: Parameters: {"locale"=>"en"} 
2015-04-01T00:07:32.248531+00:00 app[web.1]: Processing by Devise::SessionsContr 
oller#new as HTML 
2015-04-01T00:07:32.677907+00:00 heroku[router]: at=info method=GET path="/en/lo 
gin" host=pure-depths-2749.herokuapp.com request_id=e83580da-ee52-4b25-a231-3cff 
86251995 fwd="140.216.561.79" dyno=web.1 connect=2ms service=456ms status=200 by 
tes=3406 
2015-04-01T00:07:32.609568+00:00 app[web.1]: Rendered catarse_bootstrap/devise 
/shared/_header.html.slim (5.2ms) 
2015-04-01T00:07:32.631029+00:00 app[web.1]: Rendered catarse_bootstrap/devise 
/sessions/new.html.slim within layouts/catarse_bootstrap (266.0ms) 
2015-04-01T00:07:32.666289+00:00 app[web.1]: Rendered layouts/_facebook_sdk.ht 
ml.slim (4.4ms) 
2015-04-01T00:07:32.673751+00:00 app[web.1]: Rendered layouts/_crazzy_egg.html 
.slim (2.7ms) 
2015-04-01T00:07:32.683620+00:00 app[web.1]: Rendered layouts/_mixpanel.html.s 
lim (3.9ms) 
2015-04-01T00:07:32.660363+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_new_zendesk.html.slim (5.3ms) 
2015-04-01T00:07:32.618198+00:00 app[web.1]: Rendered catarse_bootstrap/devise 
/shared/_alert.html.slim (5.9ms) 
2015-04-01T00:07:32.669821+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_webfont.html.slim (2.6ms) 
2015-04-01T00:07:32.684292+00:00 app[web.1]: Completed 200 OK in 435ms (Views: 3 
27.4ms | ActiveRecord: 14.9ms) 
2015-04-01T00:07:32.678578+00:00 app[web.1]: Rendered layouts/_analytics.html. 
slim (3.7ms) 
2015-04-01T00:07:33.380677+00:00 heroku[router]: at=info method=GET path="/asset 
s/catarse_bootstrap/logo_icon_catarse-85692282dc7620548f2847e5e7e6e5cb.png" host 
=pure-depths-2749.herokuapp.com request_id=de81be15-415b-4a9e-8aff-4b91d4297276 
fwd="140.216.561.79" dyno=web.1 connect=2ms service=3ms status=200 bytes=1568 
2015-04-01T00:07:39.951866+00:00 app[web.1]: Started POST "/en/login" for 140.216.561.79 at 2015-04-01 00:07:39 +0000 
2015-04-01T00:07:39.954445+00:00 app[web.1]: Processing by Devise::SessionsContr 
oller#create as HTML 
2015-04-01T00:07:39.954483+00:00 app[web.1]: Parameters: {"utf8"=>"√", "authen 
ticity_token"=>"/rUsP9B9eYA1KuLG4XDl9tih99ux+B4zSPkeT4MhK/0=", "user"=>{"email"= 
>"[email protected]", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit 
"=>"Log me in", "locale"=>"en"} 
2015-04-01T00:07:39.955196+00:00 app[web.1]: Can't verify CSRF token authenticit 
y 
2015-04-01T00:07:40.609247+00:00 app[web.1]: Redirected to https://pure-depths-2 
749.herokuapp.com/en 
2015-04-01T00:07:40.598647+00:00 heroku[router]: at=info method=POST path="/en/l 
ogin" host=pure-depths-2749.herokuapp.com request_id=6659a072-2de9-4fdb-a78a-038 
a07477473 fwd="140.216.561.79" dyno=web.1 connect=1ms service=666ms status=302 b 
ytes=528 
2015-04-01T00:07:40.609403+00:00 app[web.1]: Completed 302 Found in 655ms (Activ 
eRecord: 19.9ms) 
2015-04-01T00:07:41.144458+00:00 app[web.1]: Started GET "/en" for 190.213.201.6 
1 at 2015-04-01 00:07:41 +0000 
2015-04-01T00:07:41.854964+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-04-01T00:07:41.629591+00:00 app[web.1]: Processing by ProjectsController#in 
dex as HTML 
2015-04-01T00:07:41.865902+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-04-01T00:07:41.629618+00:00 app[web.1]: Parameters: {"locale"=>"en"} 
2015-04-01T00:07:41.824286+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_header.html.slim (41.7ms) 
2015-04-01T00:07:41.824389+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_header_big.html.slim (70.6ms) 
2015-04-01T00:07:41.860880+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/_card.html.slim (0.0ms) 
2015-04-01T00:07:43.471706+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_navigate.html.slim (1.3ms) 
2015-04-01T00:07:43.529342+00:00 app[web.1]: Rendered layouts/_crazzy_egg.html 
.slim (0.0ms) 
2015-04-01T00:07:43.512371+00:00 app[web.1]: Rendered layouts/_facebook_like.h 
tml.slim (0.2ms) 
2015-04-01T00:07:43.446464+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_welcome.html.slim (29.7ms) 
2015-04-01T00:07:43.528566+00:00 app[web.1]: Rendered layouts/_facebook_sdk.ht 
ml.slim (0.3ms) 
2015-04-01T00:07:43.513779+00:00 app[web.1]: Rendered catarse_bootstrap/projec 
ts/index.html.slim within layouts/catarse_bootstrap (1762.5ms) 
2015-04-01T00:07:43.544384+00:00 app[web.1]: Rendered layouts/_mixpanel.html.s 
lim (1.1ms) 
2015-04-01T00:07:43.527946+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_new_zendesk.html.slim (1.1ms) 
2015-04-01T00:07:43.470271+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_about.html.slim (23.3ms) 
2015-04-01T00:07:43.510538+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_newsletter.html.slim (28.8ms) 
2015-04-01T00:07:43.513489+00:00 app[web.1]: Rendered catarse_bootstrap/shared 
/_footer_big.html.slim (96.9ms) 
2015-04-01T00:07:43.528854+00:00 app[web.1]: Rendered catarse_bootstrap/layout 
s/_webfont.html.slim (0.0ms) 
2015-04-01T00:07:43.542880+00:00 app[web.1]: Rendered layouts/_analytics.html. 
slim (1.1ms) 
2015-04-01T00:07:43.544992+00:00 app[web.1]: Completed 200 OK in 1915ms (Views: 
1787.5ms | ActiveRecord: 12.2ms) 
2015-04-01T00:07:43.587039+00:00 heroku[router]: at=info method=GET path="/en" h 
ost=pure-depths-2749.herokuapp.com request_id=5b147858-38f1-4bbe-8b5e-2523b2f899 
a0 fwd="140.216.561.79" dyno=web.1 connect=2ms service=2611ms status=200 bytes=5 
295 
2015-04-01T00:07:52.789200+00:00 heroku[web.1]: Error R14 (Memory quota exceeded 
) 
2015-04-01T00:07:52.789160+00:00 heroku[web.1]: Process running mem=536M(104.8%) 
+0

問題解決了嗎?我面臨同樣的問題。 – 2016-06-08 18:53:55

回答

0

的問題是很模糊,所以這將是更多的是關於如何進行和指導服用,而不是一個故事直接的答案,這是沒有足夠的信息。

首先,您不應該在Heroku上進行調試 - 即在生產中 - 除非您特別需要,並且如果需要在Heroku上進行調試,則應該設置獨立於生產環境的臨時環境,在至少有一次你有用戶。您需要將此應用程序設置爲在您的本地系統上運行,其中調試將更容易,更快速,並且不會中斷應用程序的任何用戶。

在本地,您可以運行應用程序rails server,它將以調試模式運行,它會在每個請求上重新加載整個應用程序,這樣您甚至不必重新啓動服務器即可查看更改。您還可以使用Ruby調試器(例如RubyMinepry)遍歷代碼。它還會將更詳細的信息記錄到標準輸出中,您可以用它來幫助弄清楚發生了什麼。

接下來,通過快速檢查,似乎應用程序正在使用devise gem來管理登錄。這通常是一個很好的選擇。當您使用Devise登錄和其他相關操作時,通常會將任何文本結果放入flash。如果您在視圖中設置了顯示閃光燈的位置,您會看到此內容。如果你不這樣做,那麼你應該,如果你不知道那是什麼,那麼請閱讀它。

接下來,你是如何創建你正在嘗試登錄的用戶?你應該看看你的數據庫,看看你的用戶是否真的存在。檢查模型以查看哪個模型配置爲用戶,以及設計使用哪些模塊。根據配置的方式,設計可能不允許您登錄,除非您點擊了創建帳戶時可能嘗試給您發送電子郵件的確認鏈接 - 如果您沒有正確配置電子郵件,或者創建了用戶在數據庫中手動操作,您甚至可能沒有注意到這是一個沒有很多硬調試的問題。

相關問題