I have updated all the brew formulas with
brew update && brew upgrade. I after I upgrading I noticed that rails is not found but when I type
/usr/bin/rails. All I can guess is I have to add rails path to
.zshrc again. But, I am not sure what all I need to add to
What are all the things that update broke.
# Adding bin to PATH for sublime
# Rbenv stores data under ~/.rbenv by default. If you absolutely need to
# store everything under Homebrew's prefix, include this in your profile:
# Ruby Motion android tool
# display how long all tasks over 10 seconds take
[[ -e ~/.terminfo ]] && export TERMINFO_DIRS=~/.terminfo:/usr/share/terminfo
# define the code directory
# This is where my code exists and where I want the `c` autocomplete to work from exclusively
if [[ -d ~/code ]]; then
# source all .zsh files inside of the zsh/ directory
for config ($ZSH/**/*.zsh) source $config
if [[ -a ~/.localrc ]]; then
# initialize autocomplete
autoload -U compinit
for config ($ZSH/**/*completion.sh) source $config
# add /usr/local/sbin
if [[ -d /usr/local/sbin ]]; then
# adding path directory for custom scripts
# check for custom bin directory and add to path
if [[ -d ~/bin ]]; then
[ -z "$TMUX" ] && export TERM=xterm-256color
# install rbenv
if hash rbenv 2>/dev/null; then
eval "$(rbenv init -)"
if [[ -d ~/.rvm ]]; then
PATH=$HOME/.rvm/bin:$PATH # Add RVM to PATH for scripting
# alias git to hub
if hash hub 2>/dev/null; then
eval "$(hub alias -s)"
# source nvm
if hash brew 2>/dev/null; then
source $(brew --prefix nvm)/nvm.sh
source `brew --prefix`/etc/profile.d/z.sh
# Base16 Shell
# if [ -z "$THEME" ]; then
if [ -z "$BACKGROUND" ]; then
# [[ -s $BASE16_SHELL ]] && source $BASE16_SHELL
. $(brew --prefix nvm)/nvm.sh
# Online help for ZSH
The only solution I came across is to re-install ruby & rails. I think while upgrading rbenv existing install somehow got removed
# Install Ruby rbenv install 2.2.3 rbenv global 2.2.3 ruby -v gem install rails -v 4.2.4 rbenv rehash rails -v # Rails 4.2.4
Most likely you have Rails squirreled away in some particular gemset in some rvm-managed Ruby version, but you haven't told rvm to use it again yet.
Look at your installed Ruby versions (with
rvm list). Chances are that the one you were using before is still there. If you recognize one, use it (with
rvm use ruby-2.2.4 or whatever version), else start looking in all the versions.
For each Ruby version you inspect, look at the gemsets rvm is managing under it (with
rvm gemset list). Chances are, you either created one for some Rails project, or as a starter for Rails projects in general (that's what I do), or maybe you just left all the gems to be installed into the
If you recognize a particular one, use it (with
rvm gemset use rails_4_2 or whatever gemset name), else start looking in all the gemsets. You'll eventually find the right combination.
If you don't, then go through the same process as from scratch. First make sure you're using the Ruby version you want (you may need to install it, with
rvm install 2.3 or whatever version). Then create a new gemset (with
rvm gemset use --create rails_4_2 or whatever you want to call it). Lastly,
gem install rails.