たれみみマンデー

【Bootstrap】デフォルトでcollapseを開いたままにする

.collapse の要素に .show を追加する

Base64とかUUIDとか

loumo.jp 勉強になったのでメモ。

【Rails】ローカルでメール確認

わかりやすかったです! メモ: techtechmedia.com

CONFLICT (content): Merge conflict in db/development.sqlite3 のエラー

git rm db/*.sqlite3 git commit -m "Removing SQLite files from git" rm .gitignore wget https://raw.githubusercontent.com/github/gitignore/master/Rails.gitignore mv Rails.gitignore .gitignore git add .gitignore git commit -m "Ignoring files …

bundle i でffiがインストールできないエラー

An error occurred while installing ffi (1.15.4), and Bundler cannot continue. Make sure that `gem install ffi -v '1.15.4' --source 'https://rubygems.org/'` succeeds before bundling. brew link --force libffi で出てくる export LDFLAGS="-L/us…

ActiveRecord::StatementInvalid: SQLite3::ReadOnlyException: attempt to write a readonly database

rails db:seed で ActiveRecord::StatementInvalid: SQLite3::ReadOnlyException: attempt to write a readonly database が出る問題は以下で解決。 stackoverflow.com はてぶろの編集画面にコードブロックない(パッとみ見当たらない)の使いづらいな。

無限ローディングをJavascriptでスクロールし続ける方法

#デベロッパーツールのコンソールで実行 ##Jsで無限スクロール const scroll = setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 1500); ###ストップ clearInterval(scroll); ##ついでに「詳しく読む」を開ける const open = s…

MySQL接続の備忘録

mysql -u rootCREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON *.* TO 'username'@'localhost'; flush privileges;

AWS × Ruby on Rails × Unicorn × Nginx の画像アップロードが異常に遅い問題

AWS(Amazon Web Services) - 【助けてください】AWSにCarrierwaveで画像をアップロードすると異常に時間がかかる(スマホからのみ)(131565)|teratail <Carriwave> => 色々試したけど変化ナシ <ImageMagick> Imagemagickのメモリ消費が激しすぎる : LIFE IS MIRACLE WIND => なんか重</imagemagick></carriwave>…

PostgreSQLのエラー

PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.54**"? のエラー解決法。 $brew services start postgres たれみみ(@taremimi…

AWSで切れたSSL証明書の更新

SSL更新が切れていて、更新する際に役にたったリンク qiita.com https://tagamidaiki.com/hard-to-upgrade-lets-encrypt-certificate/ たれみみ(@taremimi_7)

Chromeからローカルファイルにアクセスできないときの対処

The video element contains cross-origin data, and may not be loaded. とでるとき。 sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args -allow-file-access-from-files

本番環境シェルでリセット

deploy.rb %x[git pull] %x[kill -9 `pgrep -f 'unicorn' `] %x[RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:migrate:reset] %x[RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:seed]…

Devise と Omniauth のTwitter認証で画像がアップロードできない

カラム名をremote_ _url で挟むの盲点だった CarrierWaveでURLから画像を保存、アップロードする方法 - ぷれすとぶろぐ

chromeでローカルファイルにアクセスする。

ローカルファイルにアクセスする。(Mac OSX) $ sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args -allow-file-access-from-files

Three.jsでスポットライトの向きが変わらない問題

var light = new THREE.SpotLight(); light.position.set(**,**,**); light.target.updateMatrixWorld(); ← 挟む たれみみ(@taremimi_7)

【Rails5】ActionCableチャットコード

汚いのはお許しを・・・以下ソースだけ。app/assets/javascripts/channels/product.coffee jQuery(document).on 'turbolinks:load', -> open_messages = $('#open_messages') if $('#open_messages').length > 0 if (!App.product) App.product = App.cable.…

AWS+Nginx+RailsのSSL化

qiita.com ここの続きのテイ 自分用備忘録。 $cd ~ $git clone https://github.com/certbot/certbot $cd certbot $sudo -i $sudo ./certbot-auto certonly --agree-tos --webroot -w /var/www/rails/*アプリ名*/public -d hhbox.net -m *メアド --debug $/et…

AWSでSSL化する

AWSでSSL化するのにCertificateManegerだーメールサーバーが必要だーSESだーS3だーってややこしすぎて困ってたらとても簡単な記事見つけて助かりました!備忘録 www.wantedly.com aws.amazon.com

特定コントローラーのアクションにbefore_actionの例外をつける

schoolコントローラーindexアクションのみbefore_actionでnot_registered_schoolをスキップしたいとき(ややこしい、、、) class ApplicationController < ActionController::Base before_action : not_registered_school,except: [:index] ,if: :school_cont…

Railsでリロードしないとjavascriptが読み込まれない問題

やっぱりturbolinks、、、 以下を追加すれば特定のページで切れます <body data-turbolinks="false"> たれみみ (@taremimi_7)</body>

GitHub fork元リポジトリのmasterを追従

備忘録 morizyun.github.io

Cannot allocate memory - fork(2) (Errno::ENOMEM) unicorn logのエラー

こんなエラーが出たので対処法。 Cannot allocate memory - fork(2) (Errno::ENOMEM) unicorn log どうやらメモリがあふれたっぽい。 GitHub - kzk/unicorn-worker-killer: Automatically restart Unicorn workers based on 1) max number of requests and 2…

Vim内でコピー(command+c)が出来ない問題

クリップボードがしんでいたので備忘録 set mouse=a じゃなくて set mouse=r たれみみ(@taremimi_7)

Rails&AWSで絵文字(utf8mb4)の対応手順

1.Rails側のconbfig/database.ymkで以下のように設定変更。 default: &default charset: utf8mb4 encoding: utf8mb4 collation: utf8mb4_general_ci adapter: mysql2 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: socket: /…

個人でカナダワーホリ申請するとき役立つリンク&Macで複数画像をまとめて1枚にするやり方

この2つ読んだらなんとかなる。 workingholiday-syrup.com カナダワーホリビザの申請方法!全体の流れをわかりやすく解説 | YOLO あとこれ↓ invitationが届いてからはここを参考に入力 comnee.jp パスポートの写し(画像)については、有効期限や顔写真が載っ…

Railsでプロセスが切れないときの対処法

Rails(ローカル)でサーバ立ち上げた後うまくプロセスを切れないとき、 調べるとたくさん、 ps aux | grep rails, kill -9 **プロセス番号** がでてきますが、 kill: (*****) - No such process と出てくるので、解決法。 lsof -wni tcp:3000 kill -9 **プロ…

TwitterCardで一行に画像が表示されない対処法

<meta name="twitter:image" content="<%= asset_url('***.png') %>" /> たれみみ(@taremimi_7)</meta>

rake aborted! Uglifier::Error: Unexpected character '`' のエラー

サーバー側でrake assets:precompile RAILS_ENV=production すると rake aborted! Uglifier::Error: Unexpected character '`' のエラーが。 app/assets/javascripts/application.jsの中のjsで使っていた変数展開のバッククォートが問題だったらしいです。 <…

【Rails】1個前のcontrollerとactionを取得する

1個前のcontrollerとactionを取得する。 url = Rails.application.routes.recognize_path(request.referrer) previous_controller =url[:controller] previous_action = url[:action] たれみみ(@taremimi_7)