I have been using rbenv
for ruby for a while, and I have not had a problem with files being tracked; everything seems to be in it's place, and I haven't really had an issue.
I recently switched to rvm
for a new project, and had to change a couple things to my environment. As a result, whenever I now run bundle
, all of the gems that were added to my project become tracked via git looking something like this;
new file: vendor/bundle/ruby/2.2.0/bin/aws-rb
new file: vendor/bundle/ruby/2.2.0/bin/byebug
new file: vendor/bundle/ruby/2.2.0/bin/erubis
new file: vendor/bundle/ruby/2.2.0/bin/geocode
new file: vendor/bundle/ruby/2.2.0/bin/nokogiri
new file: vendor/bundle/ruby/2.2.0/bin/rackup
new file: vendor/bundle/ruby/2.2.0/bin/rails
new file: vendor/bundle/ruby/2.2.0/bin/rake
new file: vendor/bundle/ruby/2.2.0/bin/rdoc
new file: vendor/bundle/ruby/2.2.0/bin/ri
new file: vendor/bundle/ruby/2.2.0/bin/sass
new file: vendor/bundle/ruby/2.2.0/bin/sass-convert
new file: vendor/bundle/ruby/2.2.0/bin/scss
new file: vendor/bundle/ruby/2.2.0/bin/sdoc
new file: vendor/bundle/ruby/2.2.0/bin/sdoc-merge
new file: vendor/bundle/ruby/2.2.0/bin/spring
new file: vendor/bundle/ruby/2.2.0/bin/sprockets
new file: vendor/bundle/ruby/2.2.0/bin/thor
new file: vendor/bundle/ruby/2.2.0/bin/tilt
new file: vendor/bundle/ruby/2.2.0/bin/unicorn
new file: vendor/bundle/ruby/2.2.0/bin/unicorn_rails
new file: vendor/bundle/ruby/2.2.0/cache/actionmailer-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/actionpack-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/actionview-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/activejob-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/activemodel-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/activerecord-4.2.6.gem
new file: vendor/bundle/ruby/2.2.0/cache/activesupport-4.2.6.gem
and because of this, github doesn't display the entirety of my commits, my git add
's take forever, overall it's just very messy.
With rbenv
I did not have this problem, so I can only assume it's something to do with how I set up rvm
. Here's my current bash_profile
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
# RBENV - add bin and shims to path
export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
# Bash completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Git completion
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
# Aliases
alias b="bundle exec"
alias t="RAILS_ENV=test"
alias bi="bundle install; rbenv rehash"
alias bu="bundle update; rbenv rehash"
# message from RVM (5/2/16)
# first attempt below
#source /Users/username/.rvm/scripts/rvm
# next attempt below
source ~/.rvm/scripts/rvm
I believe this current tracking is due to how my path's are set up, and that is something I do not know too much about currently.
I was wondering if anyone has had some experience with this, if they could tell me how I could stop all of the gems I download from being tracked by git. Any help would be appreciated :)
here's my .bundle/config
file
---
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: true
here's the output of rvm env
export PATH="/Users/username/.rvm/gems/ruby-2.2.3/bin:/Users/username/.rvm/gems/ruby-2.2.3@global/bin:/Users/username/.rvm/rubies/ruby-2.2.3/bin:$PATH"
export GEM_HOME='/Users/username/.rvm/gems/ruby-2.2.3'
export GEM_PATH='/Users/username/.rvm/gems/ruby-2.2.3:/Users/username/.rvm/gems/ruby-2.2.3@global'
export MY_RUBY_HOME='/Users/username/.rvm/rubies/ruby-2.2.3'
export IRBRC='/Users/username/.rvm/rubies/ruby-2.2.3/.irbrc'
unset MAGLEV_HOME
unset RBXOPT
export RUBY_VERSION='ruby-2.2.3'
here's the output of which ruby
/Users/username/.rvm/rubies/ruby-2.2.3/bin/ruby
You have to remove .bundle/config (It's a per project configuration that overrides your user preferences).
Ensure you are using right Ruby's version ($rvm list rubies
will show your current Ruby version used in this current path)
If you're using the required Ruby version for the project then you should have installed bundler gem for this Ruby version and it should be work.