Ruby on Rails: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 10: Line 10:
<source lang="bash">
<source lang="bash">
if  [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
if  [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
     [[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then
     [[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/.profile)" == 0 ]];then
         tee -a ${HOME}/.profile >/dev/null <<'EOF'
         tee -a ${HOME}/.profile >/dev/null <<'EOF'


# rvm config
# rvm path setting
if  [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
if  [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
     [[ -x "${HOME}/.rvm/scripts/rvm" ]];then
     [[ -x "${HOME}/.rvm/bin/rvm" ]];then


     export PATH=${HOME}/.rvm/bin:${PATH}
     export PATH=${HOME}/.rvm/bin:${PATH}
fi
EOF
fi
</source>
<source lang="bash">
if  [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
    [[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then
        tee -a ${HOME}/.profile >/dev/null <<'EOF'
# rvm script loading
if  [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
    [[ -x "${HOME}/.rvm/scripts/rvm" ]];then
   
     source ${HOME}/.rvm/scripts/rvm
     source ${HOME}/.rvm/scripts/rvm
fi
fi

Revision as of 23:04, 11 March 2023

Ruby » RVM

sudo apt install gnupg2
gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable

Ruby » RVM » Profile


if  [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
    [[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/.profile)" == 0 ]];then
        tee -a ${HOME}/.profile >/dev/null <<'EOF'

# rvm path setting
if  [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
    [[ -x "${HOME}/.rvm/bin/rvm" ]];then

    export PATH=${HOME}/.rvm/bin:${PATH}
fi
EOF
fi
if  [[ -e ${HOME}/.profile ]]&&[[ -s ${HOME}/.profile ]]&&
    [[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/.profile)" == 0 ]];then
        tee -a ${HOME}/.profile >/dev/null <<'EOF'

# rvm script loading
if  [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
    [[ -x "${HOME}/.rvm/scripts/rvm" ]];then
    
    source ${HOME}/.rvm/scripts/rvm
fi
EOF
fi

Ruby » RVM » Profiles


# rvm path setting
for PROFILE_NAME in .bashrc .mkshrc .profile .zshrc;do
    if  [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&&
        [[ "$(grep -c '${HOME}/.rvm/bin/rvm' ${HOME}/${PROFILE_NAME})" == 0 ]];then
            tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF'

# rvm path setting
if  [[ ! "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
    [[ -x "${HOME}/.rvm/bin/rvm" ]];then

    export PATH=${HOME}/.rvm/bin:${PATH}
fi
EOF
    fi
done
# rvm script loading
for PROFILE_NAME in .bash_profile .profile .zlogin;do
    if  [[ -e ${HOME}/${PROFILE_NAME} ]]&&[[ -s ${HOME}/${PROFILE_NAME} ]]&&
        [[ "$(grep -c '${HOME}/.rvm/scripts/rvm' ${HOME}/${PROFILE_NAME})" == 0 ]];then
            tee -a ${HOME}/${PROFILE_NAME} >/dev/null <<'EOF'

# rvm script loading
if  [[ "${PATH}" =~ "${HOME}/.rvm/bin:" ]]&&
    [[ -x "${HOME}/.rvm/scripts/rvm" ]];then
    
    source ${HOME}/.rvm/scripts/rvm
fi
EOF
    fi
done

Ruby » RBENV

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

Ruby » RBENV » BashRC


if  [[ -e ${HOME}/.bashrc ]]&&[[ -s ${HOME}/.bashrc ]]&&
    [[ "$(grep -c '${HOME}/.rbenv/bin/rbenv' ${HOME}/.bashrc)" == 0 ]];then
        tee -a ${HOME}/.bashrc >/dev/null <<'EOF'

# rbenv config
if  [[ ! "${PATH}" =~ "${HOME}/.rbenv/bin:" ]]&&
    [[ -x "${HOME}/.rbenv/bin/rbenv" ]];then

    export PATH=${HOME}/.rbenv/bin:${PATH}
    eval "$(rbenv init -)"
fi
EOF
fi

References