0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

windows10のvagrantでrailsコマンドが使えないときの備忘

Last updated at Posted at 2018-09-01

windows10環境でVagrantを用いてRailsの環境構築を行ったものの、自分の環境では一度vagrantを終了すると次にVagrantに入った時、railsコマンドを認識しなくなってしまうので備忘として再認識させる方法を残します。

環境

・windows10
・VagrantのboxはCentOS72

コマンド

vagrant sshでCentOSのターミナルに接続後、以下のコマンドを入力
source ~/.bash_profile
※自分の場合は一度suを実行後にやってます。

最初にプロファイルの読み込みが上手く行ってないのだろうか・・・。

追記(2018/09/02)

コメントでアドバイスいただきました。
どうやら~/.bash_profileにパスを通していたのが原因だった模様。
~/.bashrcにパスを通したらsourceコマンドを実行しなくてもrailsコマンドを認識した。
一応、以下のコマンドを実行した。

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
(スーパーユーザーで実行した。)

ちょっとしたことでも投稿してみるものだなぁ。。。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?