突然エラーが出た
ユーザーにログインしようとすると以下のエラー。
Terminal
segmentation fault
やったこと
ルートでログインし、testというユーザーを作成する。
Terminal
$ su
# useradd test
新規ユーザーの.bashrcをそのままコピーする。
.bashrc
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
元ユーザーの.bashrcがおかしい
.bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
それを以下のように記述する。
.bashrc
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
おまけ
.bash_profile
.bash_profileを変更してrbenvコマンドを使えるようにする。
.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
rbenvがあるパスを指定。
.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"