Here’s the problem
JRuby + Rspec + rvm + tmux = ¯\(ツ)/¯
Let me explain, we use
JRuby and test with
Rspec. Problem is, you can’t run
JRuby and we need to switch rvm over to
mri to run the specs.
Add to this, I typically divide up one of my monitors with multiple windows split via either tmux or vim.
At least a couple of time a day, I would find myself running
rspec only to get:
This is because through my file shuffling etc, the shell I happen to be in at the time is still running
I wanted to be able to run something like
rspec spec/models/user_spec.rb and if inadvertently in the wrong shell, automatically switch to the proper ruby and gemset and
run the spec.
So, what is happening when I run
JRuby? Well, the system is looking for the executable
rspec in the selected gem path. In my case,
~/.rvm/gems/jruby-18.104.22.168@ne_profile/bin. Why not add a
rspec executable there? Actually, I’m sure there are reasons not to do this..(I did say hack right?).
So, like I said a little hacky, I’m actually going to look into a better solution, but this works for now.