Skip to content


Subversion checkout URL

You can clone with
Download ZIP


rvm-activate-corresponding-ruby gets wrong gemset name #25

tmcgilchrist opened this Issue · 8 comments

2 participants


I have rvm-mode setup like so

   (require 'rvm)
   (add-hook 'ruby-mode-hook 'rvm-activate-corresponding-ruby)

I've found that when my .rvmrc file contains comments after rvm use it doesn't correctly pickup the gemset name

rvm use --create 1.9.2@project

# Something

It'll try setting the gemset to project#

I assume that the regex "\\([^\"\s]+\\)\\)?\\(?:\"\\|\\)" that is checking for the gemset name is not halting at the newline and is picking up the # from comment.


you're right ig rvm.el does not recognize the gemset it's probably the regexp, that does not match. I've added detected for the .rvmrc generated by rvm which is also multiline. I'll look into your specific issue.


Maybe changing it to something like "\\([^\"\s\n]+\\)?\\(?:\"\\|\\)" would be better. I wouldn't expect a valid gem set name can include a newline.

I've tried that combination in Emacs RE-Builder and it seems to match on both the rvm generated .rvmrc and my one above.

If you're happy with that I can create a pull request plus tests.


if you create a test the modified regexp passes all existing scenarios it's fine for me. Just create a pull request and I'll merge it back.


is this still an issue? Please report back if so I'll look into it.


Yes this is still an issue.

But unfortunately I haven't found the time to submit a fix plus test for it. Sorry.


@tmcgilchrist I'll look into it when I got a few minutes.

@senny senny closed this in 454be97

@tmcgilchrist I pushed a fix, can you update to the latest version and see if it works?


Looks good to me. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.