RVM keeps adding directory to my PATH and then gives a warning that PATH is not configured correctly

I know there are many other questions out there regarding this problem, but I was unable to find anything for a solution that works for me, so I post if I missed something.

Using the command line, when I am cd

in the Rails site directory, RVM changes my path by adding "Users / username / bin" to the front of the PATH variable, and then throws a warning about how the PATH is not set up correctly because since the version is ruby ​​precious stones are not in the first place in the PATH.

Here's my $ PATH output before going to the ROR directory:

/Users/username/.rvm/gems/ruby-2.1.1/bin:/Users/username/.rvm/gems/ruby- 2.1.1@global/bin:/Users/username/.rvm/rubies/ruby2.1.1/bin:/Users/username/.nvm/v0.10.18/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki:/Users/username/.rvm/bin:/Users/username/.rvm/bin

      

And after changing the directory to the ROR directory:

/Users/username/bin:/Users/username/.rvm/gems/ruby-2.1.1@rorproject/bin:/Users/username/.rvm/gems/ruby-2.1.1@global/bin:/Users/username/.rvm/rubies/ruby-2.1.1/bin:/Users/username/.rvm/bin:/Users/username/.nvm/v0.10.18/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki

      

I understand that RVM has to change the PATH variable, but why does it add "Users / username / bin" to the front?

Here is my .bashrc file:

[[ -s /Users/username/.nvm/nvm.sh ]] && . /Users/username/.nvm/nvm.sh # This loads NVM

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

      

Here is my .profile file:

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

      

And the .bash_profile file:

source ~/.profile

if [ -f ~/.bashrc ]; then
  source ~/.bashrc
fi

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

      

Things I've tried:

  • rvm get stable --auto-dotfiles

  • rvm get head --auto-dotfiles

  • rvm use 2.1.1

  • uninstalling RVM completely and reinstalling
  • deleting the Rails site directory and re-cloning from github
  • reset PATH

I deleted the .profile file and removed "source ~ / .profile" from .bash_profile in 7stud and still the same result (I closed iterm and reopened it).

.ruby-gemset file:

rorproject

      

.ruby-version:

2.1.1

      

Gemfile

source 'https://rubygems.org'
source 'http://rails-assets.org'

gem 'rails', '~> 4.0.0'
gem 'mysql2'
gem 'unicorn-rails'
gem "active_model_serializers", "~> 0.8.0"
gem 'foreman'
gem 'sorcery', github: 'NoamB/sorcery'
gem 'cancan'
gem 'date_validator', github: 'codegram/date_validator'
gem 'oj'                  # faster json handling
#gem 'oj_mimic_json'       # for OJ integration w/ ROR 4.1+
gem 'rails-patch-json-encode' # for OJ integration w/ ROR < 4.1
gem 'acts-as-taggable-on'
gem 'haml-rails'          # Used by the frontend app, via grunt, and for PDF generation
gem 'will_paginate'
gem 'paper_trail', '~> 3.0.1'
gem 'state_machine'

gem 'sprockets-rails'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'

# Attachment handling
gem 'carrierwave'
gem 'fog'
gem 'mime-types'
gem 'aws-sdk'
gem 'unf'
gem 'mini_magick'

# PDF Calendars
gem 'wkhtmltopdf-binary'
gem 'wicked_pdf'

# Excel output
gem 'axlsx_rails'

# Exception reporting
gem "sentry-raven"

# Soft deletes
gem 'paranoia', '~> 2.0'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use debugger
group :development, :test do
  gem 'debugger'
  gem 'rspec-rails', '~> 2.0'
  gem 'spork-rails', :github => 'sporkrb/spork-rails'

  gem 'guard'
  gem 'guard-bundler'
  gem 'guard-rspec'
  gem 'guard-spork'
  gem 'guard-process'
  gem 'guard-migrate', :github => 'glanotte/guard-migrate'

  gem 'quiet_assets'
  gem 'factory_girl_rails', :require => false
  gem 'faker'
end

group :development do
  gem 'factory_girl_rails'  # Do the require in dev, so rails generators can make factories
end

group :test do
  gem 'database_cleaner'

  gem 'simplecov',      :require => false
  gem 'simplecov-rcov', :require => false
end

      

I don't have a .rvmrc file or a .versions.conf file.

I am at a complete loss and any help would be appreciated. Thanks in advance.

+2


source to share


1 answer


  • Get rid of the .profile file. Delete it.

  • Remove the line in .bash_profile: source ~/.profile

If that doesn't help, please post your Gemfile and .rvmrc to your project directory (if any) and / or .ruby-version, .ruby-gemset, .versions.conf.

Reply to comment:



I would try to delete your two files: .ruby-gemset and .ruby-version, and then use the following lines in the Gemfile:

ruby '2.1.1'
#ruby-gemset=rorproject

      

They really should do the same, but we'll see.

0


source







All Articles