spacemacs
spacemacs copied to clipboard
ruby layer with rvm sets ruby version and gemset on every file open within a project
Description
RVM ruby version and gemset is being set on every *.rb file open withing a rails project
Reproduction guide
- Start Emacs
- Open a file from rails project with .ruby-version and .ruby-gemset file present within project's root
-
SPC-p-f
and open a file file within a project - Navigate to another file
- Open the file
Observed behaviour: Ruby version and ruby gemset is being set on every file open which takes some time.
Expected behaviour: Ruby version and ruby gemset is set once for a project containing either .rvmrc or .ruby-version files.
System Info :computer:
- OS: darwin
- Emacs: 25.1.1
- Spacemacs: 0.200.9
- Spacemacs branch: master (rev. 8e1af14)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
(haskell yaml helm sql osx
(version-control :variables version-control-diff-side 'left)
git github html
(ruby :variables ruby-version-manager 'rvm ruby-test-runner 'rspec)
emacs-lisp markdown auto-completion
(spell-checking :variables spell-checking-enable-by-default nil)
custom-layers)
- System configuration features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
Backtrace
When opening 3 different files I get the following in the Messages buffer:
Ruby: 2.3.0 Gemset: gemset_name [3 times]
Disclaimer. I am not familiar with rvm
as I don't speak ruby
.
Is it bad that rvm-activate-corresponding-ruby
is called whenever you visit ruby file?
Relevant code from ruby
layer.
(spacemacs/add-to-hooks 'rvm-activate-corresponding-ruby
'(ruby-mode-hook enh-ruby-mode-hook))
It is neither good, nor bad. It is just slow. It takes up to one second to open a new buffer with ruby file. Once a buffer exists switching to it takes no time. It would be nice to have rvm activation being done once during project load, but I'm lacking skills to fix that myself.
There is a potential duplicate of the issue https://github.com/syl20bnr/spacemacs/issues/6569
This issue is still there in 2019. I confirm calling rvm-activate-corresponding-ruby
every time before opening the ruby file is the issue. It takes 7-8 seconds in my machine.
Have any of you found the solution to the problem?
I believe we should be calling rvm-activate-corresponding-ruby
asynchronously. It may be simple to say but it may be complex to implement.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
I have exactly the same issue in 2020. Moreover, when I restart a spacemacs it does rvm command for each buffer in cache. And spacemacs takes more than a minute to start working.
Still actual
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!