Loading initializers depending on platform (ruby, jruby)

Hey,

Is there an automated way of loading initializers depending on whether
you
are currently using ruby or jruby? I have an internal gem that loads
some
jRuby tasks, but I fail to run them because other non-jruby initializers
keep erroring out, understandably since they are not currently installed
as
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
end

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

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]
http://about.me/hassanschroeder
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