There is detailed howto about adding binstubs to path: https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs#adding-project-specific-binstubs-to-path . I think that's better way than @Douglas offered
spring & rvm symlink alias commands to bin/
-
09-07-2023 - |
Question
I use Rails 4 with spring
& spring-commands-rspec
gem. This question have relation to this: spring using by default
When I run time rspec
I get something like 5 seconds. If I run time bin/rspec
I have 2 seconds.
If I run time rake -T
I get 3 seconds, if I run time bin/rake -T
I get less than a second.
Where is the trouble? Why I need to run all commands through bin/
binstubs to parse them through spring
. How can I avoid that?
Related issue at github: https://github.com/jonleighton/spring-commands-rspec/issues/17#issuecomment-43174278
Solution 2
OTHER TIPS
I avoid that by explicitly calling spring
before all the commands I run, like spring rspec spec
, spring rails c
, spring rake
. And to make that easier, I aliased spring
to just s
. It's kinda impossible to integrate spring right into those binaries because, among many other reasons: RSpec, Rake and Rails binaries are not aware of Spring existence, you can't assume you (and everyone else) always wants to run commands using Spring. You can open those files in your bin folder using you text editor and see what Spring is doing there.