I recently installed jruby on a machine that also has ruby installed on it. When I do
rake something it now appears to be using the jruby interpreter. I’d like rake to use the ruby interpreter. I’d appreciate any help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What platform are you on? What’s the output of
which rake,which ruby,which jruby? How did you install jruby?I’m going to go out on a limb and guess that however you installed jruby, it overrode your “pure” ruby binary. Depending on the platform and how jruby was installed, there are a number of ways this could have happened, e.g. PATH modification, update-alternatives, etc.
My
/usr/bin/rakestarts with:So if I modified my PATH so that the jruby install directory came first and the jruby executable was aliased to ruby, then
rakeinvokes/usr/bin/env rubywhich invokes jruby.The easiest solution (in a bash shell) is to do:
The downside is this solution will only help you and may or may not be available if you’re trying to invoke rake from somewhere other than a shell prompt.
I hope that’s enough to point you in the right direction.