iT邦幫忙

0

heroku 找不到資料表 UndefinedTable: ERROR: relation "channels" does not exist

各位大大好
小弟是ruby新手 想說找個範例練習一下

因次參考了卡卡米大大"只要有心,人人都可以做卡米狗系列" 製作了一樣的LINE BOT機器人
https://ithelp.ithome.com.tw/articles/10197440

只是在中途遇到了一些問題想要請求幫忙

這是我的主程式程式碼
https://ithelp.ithome.com.tw/upload/images/20180416/201094836CshKRTjjZ.png

在前面的功能都一切正常
一直到要加上發公告功能 加上了這一段之後
Channel.find_or_create_by(channel_id: channel_id)
https://ithelp.ithome.com.tw/upload/images/20180416/20109483Xk8mxpM7XP.png
就會跳出下面這個訊息
https://ithelp.ithome.com.tw/upload/images/20180416/20109483q6IognKFbN.png
https://ithelp.ithome.com.tw/upload/images/20180416/20109483rgcGhkPxOE.png

他一直說 找不到 channels 這個 table
我進去資料庫裡面看 這個欄位是已經產生了才對
https://ithelp.ithome.com.tw/upload/images/20180416/20109483teNtxorNFf.png

https://ithelp.ithome.com.tw/upload/images/20180416/20109483L3B3W9gY6l.png
https://ithelp.ithome.com.tw/upload/images/20180416/201094833XRn7cmIEy.png

SEVER 是使用 HEROKU空間
請問各位大神們 該當何解.....

king1761 iT邦新手 5 級 ‧ 2018-04-16 16:17:19 檢舉
已解決了..........

我使用 rails generate scaffold 自動產生資料模型 再建立一個Channel 就可以了...

原本按照教學使用手動新增出來的不行...
可能少了那些東西吧..冏
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答