0

I am on Ubuntu 14.04 LTS.
I installed rvm + ruby + rails and restarted the machine.
Everything was working fine until I installed the Heroku toolbet.

When I decided to create a new project-specific gemset with rvm use ruby-2.2.1@new_app --ruby-version --create, I received this message:

Warning! PATH is not properly set up, '/home/mark/.rvm/gems/ruby-2.2.1/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.2.1'.

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

I receive the "Warning! PATH is not properly set up" warning every time I use a rvm command, such as rvm list for instance.

The output of echo $PATH is:

/usr/local/heroku/bin:/home/mark/.rvm/gems/ruby-2.2.1/bin:/home/mark/.rvm/gems/ruby-2.2.1@global/bin:/home/mark/.rvm/rubies/ruby-2.2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/mark/.rvm/bin:/home/mark/.rvm/bin:/home/mark/.rvm/bin:/home/mark/.rvm/bin

As you can see /usr/local/heroku/bin is at first place instead of /home/mark/.rvm/gems/ruby-2.2.1/bin, and this is probably causing the issue.
I suppose it would be better if /usr/local/heroku/bin were after all the rvm paths.

My .bash_profile looks fine:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

The last lines of my .bashrc file are:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

I tried to run rvm get stable --auto-dotfiles (and rvm get head --auto-dotfiles as suggested in Warning! PATH is not properly set up, usually this is caused by shell initialization files) without results.

I would change the order of the paths in $PATH and move Heroku to a more convenient place if possible and if I knew how to do it. What would you suggest?

Community
  • 1
  • 1
Asarluhi
  • 1,280
  • 3
  • 22
  • 43

1 Answers1

0

Matthew Cullum's solution in RVM Warning! PATH is not properly set up solved my issue.
It seems also that for rvm to work properly it is necessary that the respective line of code in ~/bashrc be the last.

Community
  • 1
  • 1
Asarluhi
  • 1,280
  • 3
  • 22
  • 43