{"id":1155,"date":"2020-04-18T00:00:53","date_gmt":"2020-04-17T15:00:53","guid":{"rendered":"http:\/\/ji-develop.com\/blog\/?p=1155"},"modified":"2022-05-05T09:39:00","modified_gmt":"2022-05-05T00:39:00","slug":"heroku-rails%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc","status":"publish","type":"post","link":"https:\/\/ji-develop.com\/blog\/heroku-rails%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc","title":{"rendered":"\u3010Rails\u3011heroku\u3067\u30a8\u30e9\u30fc"},"content":{"rendered":"<p>heroku\u3067Rails\u3092\u52d5\u304b\u3059\u3068\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\uff08AWS cloud9\uff09\u3067\u306f\u554f\u984c\u306a\u3044\u306e\u306b\u306a\u305c\u304b<\/p>\n<p>We&#8217;re sorry, but something went wrong.<br \/>\nIf you are the application owner check the logs for more information.<\/p>\n<p>\u3068\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u753b\u9762\u304c\u3042\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b<\/p>\n<ul>\n<li>AWS cloud9\uff1aSQLite3<\/li>\n<li>heroku\uff1aPostgreSQL<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u69cb\u6210\u3067\u3042\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u66f4\u65b0\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u826f\u3044\u3002\u3068\u3044\u3046\u306e\u304c\u591a\u304f\u30d2\u30c3\u30c8\u3057\u305f\u304c<\/p>\n<pre>ec2-user:~\/environment $ heroku run rake db:migrate<\/pre>\n<p>\u3053\u308c\u3067\u3082\u89e3\u6c7a\u305b\u305a\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u5bfe\u51e6\u65b9\u6cd5<\/h2>\n<pre>heroku logs --tail<\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30ed\u30b0\u3092\u773a\u3081\u3064\u3064\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068<\/p>\n<pre>key = params[:key]\r\n@data = Table.where('key=\"' + key + '\"').first<\/pre>\n<p>\u3053\u308c\u304c\u60aa\u3055\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u3002<br \/>\n\u6587\u5b57\u5217\u5909\u6570\u3092\u30c0\u30d6\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u62ec\u3063\u3066\u3044\u308b\u66f8\u304d\u65b9\u304c\u3044\u3051\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3002<\/p>\n<pre>key = params[:key]\r\n@data = Table.where(\"key='\" + key + \"'\").first<\/pre>\n<p>&nbsp;<\/p>\n<p>SQLite\u3067\u306f\u6587\u5b57\u5217\u5909\u6570\u3092\u30c0\u30d6\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u62ec\u3063\u3066\u3082\u554f\u984c\u306a\u304b\u3063\u305f\u304c\u3001PostgreSQL\u306f\u30c0\u30e1\u3089\u3057\u3044\u3002<\/p>\n<p>\u57fa\u672cRails\u306fDB\u4f9d\u5b58\u3057\u306a\u3051\u3069\u3001\u3053\u306e\u5dee\u306f\u5438\u53ce\u3057\u3066\u304f\u308c\u306a\u3044\u306e\u304b\u2026\u3002<\/p>\n<p>SQL\u3092\u767a\u884c\u3059\u308b\u30ed\u30b8\u30c3\u30af\u306b\u5bfe\u3057\u3066\u306f\u3001\u6587\u5b57\u5217\u5909\u6570\u306f\u30b7\u30f3\u30b0\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u62ec\u308b\u3068\u3044\u3046\u306e\u3092\u57fa\u672c\u30eb\u30fc\u30eb\u306b\u3057\u3066\u304a\u3044\u305f\u65b9\u304c\u3088\u3044\u3068\u3044\u3046\u304a\u8a71\u3067\u3057\u305f\u3002<\/p>\n<p>\u3010\u95a2\u9023\u3011<br \/>\n<a href=\"https:\/\/ji-develop.com\/blog\/heroku-rails%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc%ef%bc%88%ef%bc%92%ef%bc%89\">heroku Rails\u3067\u30a8\u30e9\u30fc\uff08\uff12\uff09<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>heroku\u3067Rails\u3092\u52d5\u304b\u3059\u3068\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\uff08AWS cloud9\uff09\u3067\u306f\u554f\u984c\u306a\u3044\u306e\u306b\u306a\u305c\u304b We&#8217;re sorry, but something went wrong. If you are the app&#8230;<\/p>\n","protected":false},"author":1,"featured_media":426,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[21,19,8],"tags":[],"class_list":{"0":"post-1155","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-postgresql","8":"category-rails","9":"category-8","10":"article cf"},"_links":{"self":[{"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/posts\/1155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/comments?post=1155"}],"version-history":[{"count":13,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/posts\/1155\/revisions"}],"predecessor-version":[{"id":1223,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/posts\/1155\/revisions\/1223"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/media\/426"}],"wp:attachment":[{"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/media?parent=1155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/categories?post=1155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ji-develop.com\/blog\/wp-json\/wp\/v2\/tags?post=1155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}