Problem with warbler

I’m trying to use warble to build a war file, and I’m getting:

cp
/Users/jamesmoore/.gem/jruby/1.8/specifications/activerecord-jdbcmysql-adapter-0.9.2.gemspec
tmp/war/WEB-INF/gems/specifications/activerecord-jdbcmysql-adapter-0.9.2.gemspec
rake aborted!
Cannot load gem at
[/opt/local/lib/ruby/gems/1.8/cache/activerecord-jdbcmysql-adapter-0.9.2.gem]
in /Users/jamesmoore/dev/projects/ga.git
/Users/jamesmoore/dev/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/format.rb:41:in
`from_file_by_path’
(See full trace by running task with --trace)

It looks like it’s trying to pull the activerecord-jdbcmysql-adapter
from the MRI gem directory instead of the ~/.gem version where it’s
installed.

Suggestions?

Versions:

jamesmoore@james-moores-macbook-pro-2:~/dev/ga$ gem -v
1.3.5
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot™ 64-Bit Server VM 1.6.0_15) [x86_64-java]
warbler (0.9.14)


James M.
[email protected]
http://jamesmoorecode.blogspot.com/


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Do you have GEM_HOME set as an environment variable?

-Justin

On Wed, Nov 11, 2009 at 1:47 PM, James M. [email protected]
wrote:

(See full trace by running task with --trace)
1.3.5
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, Nov 11, 2009 at 12:47 PM, James M. [email protected]
wrote:

It looks like it’s trying to pull the activerecord-jdbcmysql-adapter
from the MRI gem directory instead of the ~/.gem version where it’s
installed.

Put this in config/preinitializer.rb:

if defined?(::JRUBY_COMPILED_WAR)

Set the gem home to the gem path when running as a war, to ensure

we don’t pick up any system gems, only gems bundled in the war
ENV[‘GEM_HOME’] = Gem.path.first
end

The ::JRUBY_COMPILED_WAR is a switch which we only set if we are
running from a WAR, if you always run from a war (which I wouldn’t
recommend unless you like watching paint dry) you can omit that.

– Chad


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email