Loading initializers depending on platform (ruby, jruby)


Is there an automated way of loading initializers depending on whether
are currently using ruby or jruby? I have an internal gem that loads
jRuby tasks, but I fail to run them because other non-jruby initializers
keep erroring out, understandably since they are not currently installed
jruby gems.

Assuming the following gemfile:

gem rails

platform :ruby do
ruby ‘2.1.0’ if RUBY_ENGINE == ‘ruby’
gem A # Not needed when running jruby

platform :jruby do
ruby ‘1.9.3’ if RUBY_ENGINE == ‘jruby’
gem ‘internal_gem’

No ideas on this fellas?

On Mon, May 5, 2014 at 1:19 AM, Wael [email protected] wrote:

No ideas on this fellas?

No idea what you’re talking about…

On Wednesday, April 30, 2014 2:39:32 PM UTC+2, Wael wrote:

I won’t be able to run anything provided by ‘internal_gem’ unless I move
gem A to the jruby platform

First you say ‘gem A’ isn’t needed when running jruby, then you say
it is – which is the actual case?

If you need a gem for all platforms, just include it normally (outside
the platform blocks).

Or please explain the problem more clearly…

Hassan S. ------------------------ [email protected]
twitter: @hassan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs