2017-05-01から1ヶ月間の記事一覧
Ruby Railsで tmpfileを使ってCSVを使う方法 単純でありきたいだけどいつもわすれる。 今回は、SJISでencordingしつつ アーティスト名と曲名の一覧のCSVを作成する。 (また、所要でFTPに上げる) # tmpfile作成 tf = Tempfile.new(["hogehoge", '.csv'], en…
とあるアーティストの曲を取得したい場合を考える 「曲の一覧」というリンクをクリックすると そのアーティストの一覧を取得して、曲の一覧をモーダルで出す。 index.haml:曲の一覧を表示する %a.open_modal{disable: true, id: @artist.id} 曲の一覧 - con…
heroku環境下で動いているrailsは、sitemap_generator gemだけではうまく動かない (作成したファイルを置けないなんだよ。。。) github.com そこで、AWSのS3に置く方法を用いる sitemapの作成 sitemap_generator gemをインストールして rake sitemap:insta…
railsでiframeの高さを設定するのが以外とめんどくさかった cssで設定するとよろし レスポンシブにもなる test.css .iframe { width: 100%; height: 500px; } @media screen { .iframe-wrapper { position: relative; width: 100%; } .iframe { position: ab…
rspecを使った、helperのテスト方法 基本は他のテストと同じ 記述方法 app/helpers/test_helper.rb module TestHelper def test_method 'テストだよ' end end spec/helpers/test_helper.rb require 'rails_helper' RSpec.describe TestHelper do include Tes…
herokuにrailsプロダクトをアップロードするにあたり、 ridgepoleでつまづいた エラー1:[ERROR] No such file or directory @ rb_sysopen - /app/config/database.yml ridgpoleを実行する際、下記コードを実行するのだが heroku run 'bundle exec ridgepole…
herokuにrailsプロダクトをアップロードするにあたり、 ridgepoleでつまづいた エラー1:[ERROR] No such file or directory @ rb_sysopen - /app/config/database.yml ridgpoleを実行する際、下記コードを実行するのだが heroku run 'bundle exec ridgepole…
Kerasでモデルの学習を行っていると、時間だけを浪費している瞬間がどうしてもでてくる。 そこで、AWSのg2インスタンスで、GPUを使って効率化を図った 今回は、GPUを使うための環境設定と、kerasのインストールを行う AWS g2.2xlergeの立ち上げ kerasのバッ…
Webサイト作っていると、パンくずリスト作りたくなる。 railsではいい感じにしてくれるgemがある。 github.com gemfileに上記gem追加して、bundle installする。 アーティスト>曲の場合 app/controllers/songs_controller.rb class SongsController < Appli…
デザインセンスが無い場合に、ロゴとfaviconをどう作成するのか。 そして、それをどう反映させるのか ロゴの作成 いい感じに素早く作るならここ http://emblemmatic.org/markmaker/#/ 入力してダウンロードするだけ faviconの作成 ここが、全てのタイプのfav…
action cableを本番のnginx uninorn下で動かく設定のメモ 今回はAWSのEC2とLBを使う 前提 昔からあるLoad Balancer(現在はCLB)では動かないので 諦めて、Application Load Balancer(ALB)を使う また、AWS上でredisの設定もしておくこと nginx location /cabl…
ridgepoleを使って、rails project deploy時に bundle stderr: fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the…