Fork me on GitHub
Donation
Love RVM? A donation would help justify to my family why I spend so much time working on Open Source projects like RVM.
Recommend
If you like my work with RVM, please recommend me *with a comment as to why you recommend me* on Working With Rails – Thank You!
IRC
I am 'wayneeseguin' in #rvm on irc.freenode.net If I do not respond right away, leave a message and I'll respond or leave you a memo when I am around.
Sponsors

Blue Box Group, LLC Nuxos Group

∴ rvm help # Documentation Index

Culerity Integration with RVM

If you wish to use an rvm-based ruby and jruby with Culerity, please follow the steps below. Please note that the first set of instructions but currently rely on you using recent versions which make this task a lot simpler.

Setting up jruby

Before you can start, you need to install jruby and celerity. In a nutshell, you need to:

  1. Install jruby -
    ∴ rvm install jruby
  2. Create a celerity gemset and use it -
    ∴ rvm use jruby@celerity --create
  3. Install the celerity gem in this gemset -
    ∴ gem install celerity

Which this done, you should be able to confirm that you have celerity by doing:

∴ gem list | grep celerity

With this done, the next key step is to set up a wrapper for it. To do this, we run:

∴ rvm wrapper jruby@celerity celerity jruby

Which should create the file ~/.rvm/bin/celerity_jruby, pointing to the correct ruby. You can verify this by doing:

∴ celerity_jruby -S gem list | grep celerity

Assuming this is correct, you can move on to the next step.

Configuring Culerity to use your jruby Celerity

Once you've generated the wrapper, your next task is to tell Culerity which jruby to use. If you're on a recent version, you should be able to simply add the following to your features/support/env.rb file:

Culerity.jruby_invocation = File.expand_path("~/.rvm/bin/celerity_jruby")

Replacing ~/.rvm/bin with whatever "echo $rvm_bin_path" shows on your terminal if it fails (Thanks to Matt Patterson for simplifying this on Culerity's side).

On older versions of Culerity, you need to manually specify hooks to toggle the env. In order to do this, you need to first get the location of the jruby wrappers dir. To find this, run the following in your Terminal and note the output:

∴ dirname "$(readlink "$(which celerity_jruby)")"

Which should return something similar to "/Users/sutto/.rvm/wrappers/jruby-1.5.1@celerity" as an example. Next, you need to create features/support/culerity-hooks.rb containing the following code (with thanks to agibralter, mchung and ashleymoran):

# culerity-hooks.rb
Before("@culerity,@celerity,@javascript") do |scenario|
  unless @original_path && @rvm_jruby_path
    @original_path  = ENV['PATH']
    @rvm_jruby_path = "/Users/sutto/.rvm/wrappers/jruby-1.5.1@celerity:"
  end
  ENV['PATH'] = @rvm_jruby_path
end

After("@culerity,@celerity,@javascript") do |scenario|
  ENV["PATH"] = @original_path
end

Ensuring you replace "/Users/sutto/.rvm/wrappers/jruby-1.5.1@celerity" with the value you noted earlier.

Community Resources

RVM Documentation Index