Search code examples
ruby-on-railsrvmubuntu-14.04ubuntu-servergnome-terminal

not able to run some command in gnome terminal


I have installed Ubuntu server 14.04 on virtualbox. Then I installed packages like ruby and rails using RVM. Then I started my development in ROR.
After some time I have installed Gnome on ubuntu server. I have used this guide http://www.htpcbeginner.com/install-gui-on-ubuntu-server-14-04-gnome/

Now the probem is that I am not able to access rails, ruby commands from gnome terminal. I dont know it seems weird. I can run commands by going to non gui terminal (Ctrl + Shift + 1), but not able to do so in gnome terminal.


Solution

  • Gnome shell doesn't have local variables set unless it's set to run as a login shell.

    1. Open your "Gnome Terminal"
    2. Click on "Edit"
    3. Click on "Profile Preferences"
    4. Click on top tab "Title and Command"
    5. Check the check-box that says "Run command as login shell"
    6. Close the "Profile Preferences" with the "Close Button"
    7. Restart "Gnome Terminal"

    RVM relies heavily on your home directory local variables from .bashrc and .bash_profile. But by default the gnome terminal won't load them. This is why you need to set the terminal to Run command as a login shell.