-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Ruby version used during test invocation with Rbenv + ZSH + Spacemacs #166
Comments
Try https://github.com/purcell/exec-path-from-shell, maybe. This problem is probably not rspec-mode-specific. |
@dgutov Yeah maybe that's possible, I just invoked RSpec from within a Dired buffer by using /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler (LoadError)
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/username/Dev/projects/project/bin/spring:8:in `<top (required)>'
from bin/rspec:3:in `load'
from bin/rspec:3:in `<main>' |
Looks like that package is included within the base packages. And the function is defined within the
|
Created new issue in Spacemacs syl20bnr/spacemacs#9512 |
@dgutov So I've checked the ruby version used by other packages, specifically For example, Error message when starting an interactive ruby console session from Emacs. Console still starts anyway.
Resulting ruby version within the inf-ruby interactive session.
Results of checking the environment variables from within Emacs
|
Found a fix, solution below:Solution:Within my .zshrc I had initialized rbenv with
After moving this into my ~/.zshenv instead, restarting my shell, and restarting Spacemacs, rspec-mode found the correct Ruby version managed by rbenv and invoked the tests as expected.
|
Ouch, zsh. I just put the rbenv config into |
It's my fault for not paying attention to how Emacs invokes your environment as it boots. The strange part is that non of the other packages exhibit this problem. |
If we're talking about |
Problem:
When invoking
rspec-verify-all
from within any spec file using the keybinding CTRL+c , ,, a instead of using the Ruby binary version specified in the.ruby-version
located at the project root,rspec-mode
is invokingrspec
with the default system ruby instead.Expected behavior:
rspec-mode
was expected to invokerspec
with the Ruby version installed viaruby-build
at/Users/username/.rbenv/versions/2.2.3/bin/ruby
.Error message:
Environment notes:
Thanks for your help 👍
The text was updated successfully, but these errors were encountered: