The most likely reason you get the error:
(Gem::FilePermissionError) You don't have write permissions into the /home/vikas/.rvm/gems/ruby-1.9.2-p320/bin directory.
This is because at some point you used sudo or acted as root when using RVM to install the gem. When this happened, the ownership of the files and / or folders changed to root permissions, which you cannot revoke at startup like you do.
You donβt want to run as root or use sudo EVER when you run the rvm or gem commands if you have RVM installed to provide Ruby in the sandbox in your home directory.
To fix this, try the following command:
sudo chown -R vikas ~/.rvm
This will use sudo to change ownership of all files in the ~ / .rvm directory to your own account, from the root user. It takes at least a few seconds, so let it start.
Once this starts, you can switch to each of your Rubies and remove the installed Rails:
rvm use 1.9.2 gem uninstall rails gem install rails -v 3.2.13
Then:
rvm use 2.0.0 gem uninstall rails gem install rails -v [whatever version you want] gem install rails -v
source share