AR ホームベーカリー

オイラのアウトプット用ホームベーカリー!

whenever で cron を設定すると bundle: command not found

産業で

whenever 実行するユーザの 環境変数 PATH/usr/local/bin を追加しろ

2020/01/10 追記

以下のように whenever の設定ファイルに PATH を設定すると PATH を設定できる。 ログ出力と合わせて記述すると確認しやすくて良い、こっちのほうが楽ちんですね。 しかし、他の cronjob が設定されていると、ぶつかって crontab が壊れるので注意しないといけない。

config/schedule.rb

set :output, "#{Rails.root}/log/cron.log"
env :PATH, "/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
続きを読む

Mojave に引っ越ししたけどフォントがきたない

りんご「Retina ディスプレイならきれいだから!」

うるせえ!

このようにすると、 以前の macOS みたいなフォントレンダリングに戻る

海外コメント兄貴すごい、どうやって見つけてくるんだこんなオプション。

github.com

 手順

  1. ターミナルを起動する
  2. defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO と入力する
  3. ログアウトもしくは再起動する
  4. やったぜ。

ただこれアプリケーションのフォントレンダリングだけみたいで、 macOS のメニューバーのフォントレンダリングは改善しないもよう。

f:id:donbulinux:20181206192343p:plain
firefox のメニューバー

f:id:donbulinux:20181206192504p:plain
レンダリング変更した VisualStudioCode のステータスバー

こんだけ改善すればいいか、変更できる前はフォントがボケててめっちゃ目が痛かったし。

Virtualbox と Vagrant のお引越し

Virtualbox の設定ファイルの居場所

外付けのドライブなんかに移してる場合、vdiのあるディレクトリに再インストール後のパスを向けても認識されない。 以下のディレクトリのファイルも引っ越しさせる必要がある。

/Users/USER/Library/Virtualbox/

移動後

vagrant up をしようとして、ぷらぎんのインストールしてなくて怒られた。

There are errors in the configuration of this machine. Please fix
the following errors and try again:

Vagrant:
* Unknown configuration section 'vbguest'.

こうする。

vagrant plugin install vagrant-vbguest

anyenv 環境下での **env の plugin について

結論から言うと、 github のページ通りインストールした場合は ~/.anyenv/envs/**env/plugins/ 以下にインストールすれば動きます。

ndenv の例

yarn 入れるの忘れて v8.10.0 入れてしまったので、 ndenv-yarn-install 入れつつ再インストールして動きを見ます。

ndenv-yarn-install インストール

○ → git clone https://github.com/pine/ndenv-yarn-install.git  /Users/USER/.anyenv/envs/ndenv/plugins/ndenv-yarn-install

動作確認

node インストール時に一緒に yarn も入るかな? すでにインストール済みの v8.10.0 を再インストールして動作確認します。 continue with installation? (y/N)y と答えれば再インストールできます。

○ → ndenv install 8.10.0
ndenv: /Users/USER/.anyenv/envs/ndenv/versions/8.10.0 already exists
continue with installation? (y/N) y
Downloading node-v8.10.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v8.10.0/node-v8.10.0-darwin-x64.tar.gz
Installing node-v8.10.0-darwin-x64...
Installed node-v8.10.0-darwin-x64 to /Users/USER/.anyenv/envs/ndenv/versions/8.10.0

Installing Yarn...
/Users/USER/.anyenv/envs/ndenv/versions/8.10.0/bin/yarn -> /Users/USER/.anyenv/envs/ndenv/versions/8.10.0/lib/node_modules/yarn/bin/yarn.js
/Users/USER/.anyenv/envs/ndenv/versions/8.10.0/bin/yarnpkg -> /Users/USER/.anyenv/envs/ndenv/versions/8.10.0/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.12.3
added 1 package in 1.145s
Installed Yarn 1.12.3

やったね! yarn もインストールされました。

perl: warning: Please check that your locale settings

rbenv 入れてから「今は anyenv なんて便利なもんあっとねー?」となったので、 rbenv 削除して乗り換えた。

ら、こうなった。

○ → ndenv install 8.10.0
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "ja.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "ja.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Downloading node-v8.10.0-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v8.10.0/node-v8.10.0-darwin-x64.tar.gz
Installing node-v8.10.0-darwin-x64...
Installed node-v8.10.0-darwin-x64 to /Users/USER/.anyenv/envs/ndenv/versions/8.10.0

ゆるさんぞー! デフォルトが C ってわかってるなら (unset) くらいでガタガタ抜かすな!

vi ~/.bash_profile
(もしくは `~/.bashrc` 、どちらか存在するほうで良い)

bashなんとか

export LC_ALL="ja_JP.UTF-8"

書き終わったら

保存して、以下のコマンドを実行すればオッケー。 (シェルの再読込してるだけだから)ターミナルの再起動でもいいよ!

exec $SHELL -l

oh my bash を削除する

GitHub - ohmybash/oh-my-bash: A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

とのことだが、叩くとこうなる。

MacBook-Pro:~ USER$ uninstall_oh_my_bash
-bash: uninstall_oh_my_bash: コマンドが見つかりません

ファッキューのお気持ち。

直接削除する

lib/function.sh を見ると、最終的に展開される環境変数も含めたらこのようになっている模様。

MacBook-Pro:~ USER$ env OSH=/Users/USER/.oh-my-bash/ sh $OSH/tools/uninstall.sh
sh: /tools/uninstall.sh: No such file or directory

なんでじゃーい。

MacBook-Pro:~ USER$ ~/.oh-my-bash/tools/uninstall.sh
Are you sure you want to remove Oh My Bash? [y/N] y
Removing ~/.oh-my-bash
Looking for original bash config...
Switching back to bash
Changing shell for USER.
Password for USER:
Thanks for trying out Oh My Bash. It has been uninstalled.
MacBook-Pro:~ USER$ cat ~/.bashrc
# Path to your oh-my-bash installation.
export OSH=/Users/USER/.oh-my-bash

ああん? 消えたと思ったらアップデート管理用ファイルと .bashrc のこっとるやんけ( mojave 入れた直後で、 .bash_profile しか使ってない)。

rm -f .bashrc .osh-update

多分きれいになったはず。これで僕は bash-it 入れました!