Cannot use path parameter Gemfile path
The path parameter is not carried over. The Bundler expects to be able to find code along the way, which spoils the purpose of the offline war file.
A workaround would be to run "git init; git commit -a" on the route based gem directory and treat it as a git gem instead. Bundler can then check a copy of the code, and Warbler can store a copy in a war file.
source to share
I (unfortunately) cannot post the code for this (yet ...), but I have successfully done the following:
Hack the warbler (basically replace the whole gem packing code) to copy the gems indicated with
(normal gems arrangement -
). This copying was done almost identical to how warbler copies gems from the spec
The compiler is Monkeypatch, so when it loads specs
, they are rewritten to point to
It's not pretty, but I was very happy with this solution.
Another option I have seen is to create a directory
that contains symbolic links to all the gems used
in the Gemfile. Warbler will complain about not supporting
gems, but they will be copied to the WAR file via symlinks. I don't like this solution because you need to maintain
in Gemfile and symlink, but it's easier to implement than above.
Also, I agree with Nick Seeger that
as-is support (without any of the above hacks) deprives the target of a standalone WAR file, but a standalone WAR file is not always desirable. There are tradeoffs with a non-standalone WAR file of course, but one advantage is smaller, faster copying, unpacking, etc. Of course, supporting this would require changes to JRuby-Rack as well as Warbler.
source to share