Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deleting a ruby version causes rehash to error due to ruby_profiles.yml being out of sync #19

Closed
christophermanning opened this issue Jun 5, 2012 · 3 comments

Comments

@christophermanning
Copy link

I am using ruby-build and when I delete a ruby version, ruby_profiles.yml gets out of sync and will error when running rbenv rehash:

c@c:~/project$ rbenv rehash
/home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:343:in `ensure_capable_ruby': undefined method `ruby_version' for nil:NilClass (NoMethodError)
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:342:in `select'
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:342:in `ensure_capable_ruby'
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:396

If you just compare against the mtime of the versions directory at RbenvBundler.build_ruby_profiles that should detect if a folder/ruby version has been added/deleted.

@carsomyr
Copy link
Owner

carsomyr commented Jun 7, 2012

I'm having trouble reproducing your bug. From my understanding, the only way to get a NilClass problem is for the ruby_profile_map Hash to have a Ruby version key and a nil value. How does the plugin generate such a ruby_profiles.yml file in the first place? Would you mind sharing yours?

@carsomyr
Copy link
Owner

carsomyr commented Jun 7, 2012

How does the fix look? I committed into a temporary branch, fix-issue-19.

@christophermanning
Copy link
Author

Thanks for making those changes, but I've already deleted the broken ruby_profiles.yml file and I can't reproduce this issue starting from a fresh install. So, I can't say if this fixes the issue for sure or not.

If someone else has this issue and can reproduce it, then it might be worth merging that branch.

@carsomyr carsomyr closed this as completed Jun 8, 2012
carsomyr added a commit that referenced this issue Jun 8, 2012
… Ruby directories to determine if Rubies have been added or removed.

This should resolve issue #19.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants