{"id":230,"date":"2012-11-06T15:15:03","date_gmt":"2012-11-06T06:15:03","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=230"},"modified":"2018-11-14T16:33:59","modified_gmt":"2018-11-14T07:33:59","slug":"heroku%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e9%80%81%e4%bb%98%e3%81%95%e3%82%8c%e3%81%9f%e7%94%bb%e5%83%8f%e3%82%92s3%e3%81%b8%e4%bf%9d%e5%ad%98%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2012\/11\/06\/heroku%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e9%80%81%e4%bb%98%e3%81%95%e3%82%8c%e3%81%9f%e7%94%bb%e5%83%8f%e3%82%92s3%e3%81%b8%e4%bf%9d%e5%ad%98%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b\/","title":{"rendered":"heroku\u3067\u30e1\u30fc\u30eb\u306b\u9001\u4ed8\u3055\u308c\u305f\u753b\u50cf\u3092S3\u3078\u4fdd\u5b58\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>Hello World\uff01\uff01<\/p>\n<p>\u3069\u3046\u3082\u6751\u4e0a\u3067\u3059\u3002<\/p>\n<p>\u3042\u308b\u6848\u4ef6\u3067heroku\u3092\u4f7f\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>heroku\u3063\u3066\u3059\u3054\u3044\u3067\u3059\u3088\u306d\u3002\u9a5a\u304f\u307b\u3069\u7c21\u5358\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u7bc9\u3067\u304d\u308b\u3057\u3001\u307b\u3068\u3093\u3069\u7121\u6599\u3067\u4f7f\u3048\u308b\u3057\u3002<\/p>\n<p>\u305d\u306e\u9b45\u529b\u306b\u307f\u305b\u3089\u308c\u3066\u6848\u4ef6\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u3067\u3082\u3061\u3087\u3053\u3061\u3087\u3053\u4f7f\u3063\u305f\u308a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u8003\u3048\u305f\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<p style=\"background-color: #eef3f9; border-bottom: 5px solid; border-top: 5px solid; color: #000080; font-size: 120%; font-weight: bold; margin-bottom: 10px; margin-top: 4px; padding: 3px; text-align: center;\">\u30e1\u30fc\u30eb\u3067\u5199\u771f\u5171\u6709\uff01\uff01<\/p>\n<p>\u307e\u3041\u3088\u304f\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u306d\u3002\u3002\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3056\u3063\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<div style=\"background: none repeat scroll 0 0 #F0F0E8; border-bottom: 2px solid; border-top: 2px solid; font-size: 120%; font-weight: bold; padding: 8px 15px; color: #000000; text-align: center;\">\u30b1\u30fc\u30bf\u30a4\u3067\u5199\u771f\u3092\u64ae\u308b<\/div>\n<div style=\"text-align: center; font-size: 220%; font-weight: bold;\">\u2193<\/div>\n<div style=\"background: none repeat scroll 0 0 #F0F0E8; border-bottom: 2px solid; border-top: 2px solid; font-size: 120%; font-weight: bold; padding: 8px 15px; color: #000000; text-align: center;\">\u30e1\u30fc\u30eb\u306b\u6dfb\u4ed8\u3057\u3066\u30e1\u30fc\u30eb\u9001\u4fe1<\/div>\n<div style=\"text-align: center; font-size: 220%; font-weight: bold;\">\u2193<\/div>\n<div style=\"background: none repeat scroll 0 0 #F0F0E8; border-bottom: 2px solid; border-top: 2px solid; font-size: 120%; font-weight: bold; padding: 8px 15px; color: #000000; text-align: center;\">\u3042\u308bURL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30e1\u30fc\u30eb\u6dfb\u4ed8\u3057\u305f\u5199\u771f\u304c\u898b\u308c\u308b<\/div>\n<p>\u3066\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u5fc5\u8981\u306a\u306e\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc\u3068\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u69cb\u7bc9\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u9762\u5012\u3067\u3059\u3002<\/p>\n<p>\u3067\u3082heroku\u306a\u3089\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc\u306fheroku\u3092\u4f7f\u3063\u3066<\/p>\n<p>\u30e1\u30fc\u30eb\u95a2\u9023\u306fMailgun\u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3089\u3078\u3093\u306f<a href=\"http:\/\/lab.synergy-marketing.co.jp\/blog\/tech\/heroku-addons-mailgun\">\u5897\u7530\u3055\u3093\u306eLABBLOG<\/a>\u3067\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3055\u308c\u3066\u307e\u3059\u3002<\/p>\n<p>\u3088\u3046\u3059\u308b\u306bHTTP\u7d4c\u7531\u3067\u53d7\u3051\u53d6\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u53d7\u4fe1\u3057\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u4e2d\u8eab\u3092\u898b\u3066\u3001\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u305d\u3046\u306a\u3082\u306e\u3092\u63a2\u3057\u3060\u3057\u305f\u3089\u3044\u3044\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/documentation.mailgun.net\/user_manual.html#parsed-messages-parameters\">Mailgun\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u53c2\u7167\u3059\u308b\u3068\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u305d\u3046\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f<strong>attachment-x<\/strong>\u307f\u305f\u3044\u3067\u3059\u306d\u3002<br \/>\n\u53d7\u4fe1\u3057\u305f\u30e1\u30fc\u30eb\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u53d7\u3051\u53d6\u3063\u3066\u4e2d\u8eab\u3092\u898b\u3066\u307f\u308b\u3068\u300cattachment-1\u300d\u306b\u30d5\u30a1\u30a4\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u304a\u305d\u3089\u304f\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u304c\u8907\u6570\u3042\u308c\u3070\u3001\u300cx\u300d\u306e\u90e8\u5206\u304c\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3055\u308c\u3066\u3044\u304f\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u306f\u3053\u308c\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u4fdd\u5b58\u3057\u305f\u3089\u3044\u3044\u3093\u3067\u3059\u3051\u3069\u3002heroku\u306b\u306f\u30b9\u30c8\u30ec\u30fc\u30b8\u304c\u306a\u3044\u306e\u3067\u3001\u4eca\u56de\u306f<a href=\"http:\/\/aws.amazon.com\/jp\/s3\/\">Amazon\u306eS3<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<a href=\"https:\/\/github.com\/thoughtbot\/paperclip\">paperclip<\/a>\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306bS3\u306b\u4fdd\u5b58\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u30e2\u30c7\u30eb\u304b\u3089<br \/>\n\u30e2\u30c7\u30eb\u306e\u5185\u5bb9\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<table style=\"margin: 0px auto 20px 0px; border: border: 0 none; border-collapse: collapse; border-spacing: 0;\">\n<tbody>\n<tr>\n<th style=\"background: none repeat scroll 0 0 #F2F2F2; border: 1px solid #DDDDDD; font-weight: bold; padding: 5px; color: #000000;\">\u8ad6\u7406\u540d<\/th>\n<th style=\"background: none repeat scroll 0 0 #F2F2F2; border: 1px solid #DDDDDD; font-weight: bold; padding: 5px; color: #000000;\">\u7269\u7406\u540d<\/th>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">ID<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">id<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u30bf\u30a4\u30c8\u30eb<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">subject<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u30dc\u30c7\u30a3\u30fc<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">body<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u753b\u50cf\u540d<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">photo_file_name<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u753b\u50cf\u30b3\u30f3\u30c6\u30f3\u30c8\u30bf\u30a4\u30d7<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">photo_content_type<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u753b\u50cf\u30b5\u30a4\u30ba<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">photo_file_size<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">\u753b\u50cf\u66f4\u65b0\u65e5<\/td>\n<td style=\"border: 1px solid #DDDDDD; color: #000000; line-height: 150%; padding: 5px; word-wrap: break-word;\">photo_update_at<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u6b21\u306b\u3001s3\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308bs3.yml\u3092config\u306b\u8a18\u8ff0<\/p>\n<pre class=\"lang:yaml decode:true\">development:\r\n  bucket: picture-app-development\r\n  access_key_id: S3\u306e\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a\r\n  secret_access_key: S3\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a\r\n\r\ntest:\r\n  bucket: picture-app-test\r\n  access_key_id: S3\u306e\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a\r\n  secret_access_key: S3\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a\r\n\r\nproduction:\r\n  bucket: picture-app-production\r\n  access_key_id: S3\u306e\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a\r\n  secret_access_key: S3\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092\u8a2d\u5b9a<\/pre>\n<p>&nbsp;<\/p>\n<p>\u305d\u3057\u3066\u30e2\u30c7\u30eb\u306bpaperclip\u7528\u306e\u8a18\u8ff0\u3092\u8ffd\u52a0<\/p>\n<pre class=\"lang:ruby decode:true\">has_attached_file :photo,\r\n  :storage=&gt; :s3,\r\n  :s3_credentials =&gt; \"#{Rails.root}\/config\/s3.yml\",\r\n  :url  =&gt; \":s3_domain_url\",\r\n  :path =&gt; \":attachment\/:id\/:style.:extension\",\r\n  :styles =&gt; {\r\n    :thumb  =&gt; \"100x100&gt;\",\r\n    :medium =&gt; \"300x300&gt;\",\r\n    :large  =&gt; \"800x800&gt;\"\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u6e96\u5099OK\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u5f8c\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304c\u53d7\u3051\u53d6\u3063\u305f\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u30e2\u30c7\u30eb\u306b\u30bb\u30c3\u30c8\u3057\u3066\u4fdd\u5b58<\/p>\n<pre class=\"lang:ruby decode:true\">def def mail_post \r\n  mail_param = {\r\n    :subject =&gt; params[:subject], \r\n    :body =&gt; params[:\"body-plain\"], \r\n    :photo =&gt; params[:\"attachment-1\"]\r\n  }\r\n  picture = Picture.new(mail_param)\r\n  picture.save\r\nend<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3067\u30e1\u30fc\u30eb\u306b\u6dfb\u4ed8\u3055\u308c\u305f\u5199\u771f\u3092\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3081\u3063\u3061\u3083\u7c21\u5358\uff01\uff01<\/p>\n<p>\u4f8b\u3067\u306f<strong>\u300cattachment-x\u300d<\/strong>\u306f<strong>\u300c1\u300d<\/strong>\u306b\u56fa\u5b9a\u3057\u3066\u307e\u3059\u3051\u3069\u3001\u8907\u6570\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u5bfe\u5fdc\u3059\u308b\u306a\u3089<strong>\u300cattachment-count\u300d<\/strong>\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u30eb\u30fc\u30d7\u3055\u305b\u308b\u306e\u304c\u826f\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u30c7\u30b3\u30e1\u304c\u6dfb\u4ed8\u3055\u308c\u3066\u308b\u53ef\u80fd\u6027\u3092\u8003\u3048\u308b\u3068\u5c11\u3057\u3084\u3084\u3053\u3057\u305d\u3046\u3002\u3002\u3002<\/p>\n<p>\u3067\u3082\u3001\u7c21\u5358\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u308b\u306e\u306f\u3059\u3054\u3044\u9b45\u529b\u3067\u3059\u3057\u3001\u96e3\u3057\u3044\u6a5f\u80fd\u3082heroku\u306eadd-on\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082heroku\u3092\u4f7f\u3063\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello World\uff01\uff01<\/p>\n<p>\u3069\u3046\u3082\u6751\u4e0a\u3067\u3059\u3002<\/p>\n<p>\u3042\u308b\u6848\u4ef6\u3067heroku\u3092\u4f7f\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>heroku\u3063\u3066\u3059\u3054\u3044\u3067\u3059\u3088\u306d\u3002\u9a5a\u304f\u307b\u3069\u7c21\u5358\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u7bc9\u3067\u304d\u308b\u3057\u3001\u307b\u3068\u3093\u3069\u7121\u6599\u3067\u4f7f\u3048\u308b\u3057\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2012\/11\/06\/heroku%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%81%ab%e9%80%81%e4%bb%98%e3%81%95%e3%82%8c%e3%81%9f%e7%94%bb%e5%83%8f%e3%82%92s3%e3%81%b8%e4%bf%9d%e5%ad%98%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[43,29,22,24],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/230"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":18021,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions\/18021"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}