所以这很有趣。我编辑了一个用户配置文件,它从我所知道的移植到heroku的数据库中。它现在在第15行下面,它的id为1.以下是连接到heroku数据库后控制台的输出:
3 | Danyka | Jones | filip_nikolaus | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.252597 | 2015-09-02 05:37:35.252597 |
4 | Angelina | Kub | ebbarempel | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.258762 | 2015-09-02 05:37:35.258762 |
5 | Bo | Barton | per_hammes | pass | | http://www.theunpluggedwoodshop.com/wp-content/uploads/2012/10/giving-tree-1.jpg | Add quote.. | | | 2015-09-02 05:37:35.26435 | 2015-09-02 05:37:35.26435 |
6 | Tristian | Vandervort | ulf | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.269916 | 2015-09-02 05:37:35.269916 |
7 | Bert | Cartwright | annaschinner | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.275477 | 2015-09-02 05:37:35.275477 |
8 | Lina | Shanahan | martin | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.28096 | 2015-09-02 05:37:35.28096 |
9 | Laurel | Greenholt | hannahirthe | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.286482 | 2015-09-02 05:37:35.286482 |
10 | Victor | Becker | ingegerd_altenwerth | pass | | https://lh3.googleusercontent.com/-jMRFTtoaM9I/U81C6LW8SMI/AAAAAAAABJU/6fI9fgRLVnQ/w426-h341/giving-hand.jpg | Add quote.. | | | 2015-09-02 05:37:35.292822 | 2015-09-02 05:37:35.292822 |
11 | Devonte | Borer | ullabritt | pass | | http://2.bp.blogspot.com/-iaXdpAip50o/TVaA1dfkLKI/AAAAAAAAADI/Lc58jQMLQtw/s320/happy3.png | Add quote.. | | | 2015-09-02 05:37:35.298556 | 2015-09-02 05:37:35.298556 |
12 | guest | guest | guest | $2a$10$ntdETJrdzHPwqEeq2Kqeme3DeU9zzi8mlz/WIUTWGWwX2ijs5vkpO | | http://img03.deviantart.net/3e34/i/2011/227/8/c/epik_face_by_epikfaceplz-d46p2on.png | | | | 2015-09-03 14:48:22.145592 | 2015-09-03 14:49:26.494595 |
13 | Linda | Marie | lindaM | $2a$10$wOlYIjTVHkHReXMlcpHNReLM/V4tMTaItnNKhuRKgc2gVwlaA9r6e | | http://tremendouswallpapers.com/wp-content/uploads/2014/12/quaker-parrots-1920x1200.jpg | | | | 2015-09-04 18:01:33.644988 | 2015-09-10 04:28:42.886892 |
15 | Linda | Gaiud | codemom | $2a$10$J..1/Kyx3isJTkAJv11bf.5/DYQccXBonf9ji6U4v/szYE3Dfm89S | | https://www.denverlibrary.org/files/css_code.jpg | | | | 2015-09-08 01:59:28.34503 | 2015-09-10 04:31:01.938624 |
1 | admin | admin | admin | $2a$10$os7EetTB/e.Lfarbvt/BFO1SW.SDC9tkaE5zlprvsmF1BaKniSWi6 | | https://scontent-lga1-1.xx.fbcdn.net/hphotos-xfa1/v/t1.0-9/11119092_10206950218382306_4406697530463059534_n.jpg?oh=3b6578dc010d0ef918008fd5b96b2e18&oe=566808E1 | No one is useless in this world who lightens the burdens of another. \r+| | | 2015-09-02 05:37:35.146649 | 2015-09-12 02:52:15.04786 | t
| | | | | | | - Charles Dickens | | | | |
(13 rows)
出于某种原因,当我点击该用户名时,我得到的错误是,尽管数据库中明显存在该页面,但仍无法找到该页面。以下是网址到达该路线时的样子:
https://boiling-stream-6729.herokuapp.com/users/1
控制器很标准:
def show
@user = User.find(params[:id])
@allContributions = Payment.where(user_id: @user.id).to_a
@userContributions =[];
@allContributions.each{|c| @userContributions << Project.find(c.project_id)}
@allContributions
end
我去的任何其他个人资料,我没有这个问题,所以我只能得出结论是因为它已经在数据库中向下移动了。然而,我不明白什么是重要的,或者我应该怎么做。对于正在发生的事情以及做什么的任何意见表示赞赏!
答案 0 :(得分:1)
您应先检查heroku log
。我可以看到你的show
方法做了很多事情,我确信有些事情失败了,因为它无法找到一些相关的资源。您的heroku log
应该告诉您这一点。在这种情况下,最好先检查日志以查看确切的错误消息。