一人会社社長、家を買う。
中古マンションを購入しました。物件引き渡しまでに得た知見を、これから購入しようとしている方へ共有できたらと思います。
対象読者
以下のような方を対象にしています。
- 持ち家を購入しようと計画している
- 法人化した経営者
- 法人化して日が浅い
法人成りしたばかりだと購入は諦めた方がいい
法人成りしてまだ1~2期目の経営者様、持ち家購入は諦めてください。借入額によっては住宅ローン審査に通りません*1。それならば法人で借り入れしようと思っても、法人での借り入れはもっと審査が厳しいです*2。
ローン審査ではだいたい3期分の決算報告書が必要です。うちは2期分+3期目の試算表+個人事業主時代の確定申告書3期分を提出しました。
不動産登記書類を作るときに司法書士の方とちらっと話をしましたが、法人成りするとそれまでの収入実績はリセットされるみたいです。仮にサラリーマンとして年収1000万円が数年間続いていたとしても、法人成りした時点で加味されなくなるということです。
これから会社を作ろうとしている方、法人化前に住宅購入を済ませてください。
BoW(wsltty)のrailsコマンドで「Error: Command 'rails' not recognized」が発生したときの対処法
Bash on Ubuntu on Windows(wsltty)上にrbenvでRoRの環境を作り、rails c
やrails g model hogehoge
を実行したら以下のエラーが発生した。
$ rails c Version: 2.0.1 Usage: spring COMMAND [ARGS] Commands for spring itself: binstub Generate spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert. help Print available commands. server Explicitly start a Spring server in the foreground status Show current status. stop Stop all spring processes for this project. Commands for your application: rails Run a rails command. The following sub commands will use spring: console, runner, generate, destroy, test. rake Runs the rake command Error: Command 'rails' not recognized Usage: rails COMMAND [ARGS] The most common rails commands are: generate Generate new code (short-cut alias: "g") console Start the Rails console (short-cut alias: "c") server Start the Rails server (short-cut alias: "s") dbconsole Start a console for the database specified in config/database.yml (short-cut alias: "db") new Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app" In addition to those, there are: destroy Undo code generated with "generate" (short-cut alias: "d") plugin new Generates skeleton for developing a Rails plugin runner Run a piece of code in the application environment (short-cut alias: "r") All commands can be run with -h (or --help) for more information.
直し方は以下のサイトに書いてあった。 stackoverflow.com この質問の回答によると、以下のコマンドを実行すれば良いとのこと。
rake rails:update:bin
無事にrailsコマンドが正常に動作するようになった。
原因だが、Macで作ったRailsプロジェクトをリポジトリから取得して作業したためbin/railsがそのまま使われており、おそらくそれでプラットフォームの違いがあり正常動作しなかったと思われる。
Bash on Ubuntu on Windows(wsltty経由)はletter_opener_webを使う
Railsの開発でメールを送信するときに便利なletter_opener。 github.com ただBash on Ubuntu on Windows上だとブラウザが開けないので、送信されたメールの内容が確認できない。
そこでletter_opener_webを使う。 github.com
まずはGemfileに以下の記述を追加する。
gem 'letter_opener_web', '~> 1.2.0', :group => :development
続いてconfig/routes.rbに以下の記述を追加する。
if Rails.env.development? mount LetterOpenerWeb::Engine, at: "/letter_opener" end
最後にconfig/environments/development.rbに以下の記述を追加する。
config.action_mailer.delivery_method = ENV['USER'] == '{your_user_name}' ? :letter_opener_web : :letter_opener
your_user_nameはenv | grep USER
で確認する。
あとはhttp://localhost:3000/letter_opener/を開けば、送信したメールが確認できる。
Windows10でPowerline用のRictyフォントを作成する方法
必要なもの
手順
- FontForgeのインストール
Bash on Ubuntu on Windows(以下BoW)で以下のコマンドを実行する。
sudo apt-get install fontforge python-fontforge - Rictyフォントを作る
プログラミング用フォント Ricty の手順を参考に以下のコマンドを実行する。
cd /mnt/c/Users/{your_name}/
mkdir font && cd font
curl -O http://www.rs.tus.ac.jp/yyusa/ricty/ricty_generator.sh
(InconsolataフォントやMigu 1Mフォントは各自でダウンロードしてfontディレクトリにttfファイルをコピーしておく)
sh ricty_generator.sh auto - powerlineのリポジトリをクローンする
Git Bashを使って、以下のリポジトリをクローンする。
https://github.com/powerline/fontpatcher
(自分はvimのプラグインで「powerline/powerline-fontpatcher」を指定してクローンした) - fontpatcherでPowerline用フォントを作成する
BoWで以下のコマンドを実行する。
python /path/to/repos/powerline/fontpatcher/scripts/powerline-fontpatcher Ricty-Bold.ttf
python /path/to/repos/powerline/fontpatcher/scripts/powerline-fontpatcher Ricty-Regular.ttf - フォントをインストールする
できあがったフォントをダブルクリックしてインストールする。
文字の間隔が広がっている場合
もし、上の手順で作ったRictyフォントの文字の間隔が広い場合は、BoW上で以下の手順を実行してフォントを作り直す。
- フォント修正スクリプトをダウンロードする
curl -O http://www.rs.tus.ac.jp/yyusa/ricty/os2version_reviser.sh - Rictyフォントを作り直す
sh os2version_reviser.sh Ricty-Regular.ttf
sh os2version_reviser.sh Ricty-Bold.ttf
sh os2version_reviser.sh RictyDiscord-Regular.ttf
sh os2version_reviser.sh RictyDiscord-Bold.ttf - Powerline用フォントを作り直す
python /path/to/repos/powerline/fontpatcher/scripts/powerline-fontpatcher Ricty-Bold.ttf
python /path/to/repos/powerline/fontpatcher/scripts/powerline-fontpatcher Ricty-Regular.ttf - フォントを再インストールする
できあがったttfファイル群を使って再インストールする。
追記:Powerline用フォントを作り直すの訂正
上記手順で「Powerline用フォントを作り直す」の箇所のpowerline-fontpatcherを呼び出すところだが、実行するの以下のエラーになることがわかった。
The required FontForge modules could not be loaded.
You need FontForge with Python bindings for this script to work.
以下のブログを参考に、「fontforge -lang=py -script /path/to/repos/powerline/fontpatcher/scripts/powerline-fontpatcher Ricty-Bold.ttf」としたら動いた。