Ruby on Rails
loumo.jp 勉強になったのでメモ。
わかりやすかったです! メモ: techtechmedia.com
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 …
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…
rails db:seed で ActiveRecord::StatementInvalid: SQLite3::ReadOnlyException: attempt to write a readonly database が出る問題は以下で解決。 stackoverflow.com はてぶろの編集画面にコードブロックない(パッとみ見当たらない)の使いづらいな。
mysql -u rootCREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON *.* TO 'username'@'localhost'; flush privileges;
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…
SSL更新が切れていて、更新する際に役にたったリンク qiita.com https://tagamidaiki.com/hard-to-upgrade-lets-encrypt-certificate/ たれみみ(@taremimi_7)
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]…
カラム名をremote_ _url で挟むの盲点だった CarrierWaveでURLから画像を保存、アップロードする方法 - ぷれすとぶろぐ
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化するのにCertificateManegerだーメールサーバーが必要だーSESだーS3だーってややこしすぎて困ってたらとても簡単な記事見つけて助かりました!備忘録 www.wantedly.com aws.amazon.com
schoolコントローラーindexアクションのみbefore_actionでnot_registered_schoolをスキップしたいとき(ややこしい、、、) class ApplicationController < ActionController::Base before_action : not_registered_school,except: [:index] ,if: :school_cont…
やっぱりturbolinks、、、 以下を追加すれば特定のページで切れます <body data-turbolinks="false"> たれみみ (@taremimi_7)</body>
備忘録 morizyun.github.io
こんなエラーが出たので対処法。 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…
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: /…
Rails(ローカル)でサーバ立ち上げた後うまくプロセスを切れないとき、 調べるとたくさん、 ps aux | grep rails, kill -9 **プロセス番号** がでてきますが、 kill: (*****) - No such process と出てくるので、解決法。 lsof -wni tcp:3000 kill -9 **プロ…
<meta name="twitter:image" content="<%= asset_url('***.png') %>" /> たれみみ(@taremimi_7)</meta>
サーバー側でrake assets:precompile RAILS_ENV=production すると rake aborted! Uglifier::Error: Unexpected character '`' のエラーが。 app/assets/javascripts/application.jsの中のjsで使っていた変数展開のバッククォートが問題だったらしいです。 <…
1個前のcontrollerとactionを取得する。 url = Rails.application.routes.recognize_path(request.referrer) previous_controller =url[:controller] previous_action = url[:action] たれみみ(@taremimi_7)
Railsのコントローラー内の話。 redirect_to にcontroller,action,id指定しつつflashを追加する場合、 redirect_to ({controller: '****s', action: '****',id: params[:id]}), flash: {success: '更新されました'} ({})で囲うの知らなかったのでメモ。 たれ…
1.mysql_config --socket で mysqlのソケット位置確認 2.confid/database.yml内で socket=**1の結果** を記述 3.mysql --help | grep my.cnf でmy.confの位置確認 4.でてきたファイルを1こずつ開いて、すでに中に何か書いてあるファイルの中に [mysqld] sock…
メモ Use the generator to remove configuration files as well (step 2), so the whole process would be (referencing previous answers): Remove the table: rake db:rollback VERSION=<insert the version number of the migration> Remove the configuration: rails destroy devise:install Remove </insert>…
bundle install したとき Bundled gems are installed into `./vendor/bundle` ってなるときいろいろバグった。 bundle config bundle config --delete **** からの再度bundle install でOkay。
春はあけぼの。たれみみです。 今回は宣伝です! 初めて1人でアプリ作りましたー!(拍手) 『ホメホメ箱』リリースしました!よかったらつかってみてください(*´꒳`*)https://t.co/y0AfSSfzrA— ホメホメ箱 (@homehome_bako) 2018年2月2日 ※追記 ドメインをhhb…
github.com config/environments/production.rb で config.assets.compile = true とすると反映されましためでたしめでたし What the f*ck?! lol @taremimi_7
log/unicorn.log以下 ERROR -- : Can't connect to local MySQL server through socket '/tmp/mysql.sock' mysql_config --socket で場所確認、変更 ↓ ERROR -- : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' ↓ sudo /…
Gmailでやってきます。 Amazon SESは使いません。 config/environments/production.rb ↓ 以下追加 config.action_mailer.default_url_options = { :host => "***ドメインかIP ***" } 以上!(なんか少ない気がするけど笑) 思い出したら追記します。 たれみみ …
Redisは使いません。 AWS上 /etc/nginx/conf.d/*******.conf ↓ location /cable { proxy_pass http://app_server(upstream *****と同じやつ)/cable; proxy_http_version 1.1; proxy_set_header Upgrade websocket; proxy_set_header Connection Upgrade; pro…