You don??™t
need to package JRuby, though, because the standard packaging in GoldSpike will include all
these things. This is all you need to have the WAR file working. You build it by running this
command:
jruby -S rake war:standalone:create
This command shows you some output describing what??™s currently happening; you can
see what Gems are added to the archive and also what libraries get added by default. This
finally generates a file named the same as the current application; for example, shoplet.war.
The final step in all these schemes is to deploy the WAR file in a web container. This is the nice
part. Provided you have an installed Tomcat, Jetty, or GlassFish installation, you can just copy
the WAR files to their respective autodeploy directories, and the Rails application will get
started inside the server. You can use all the regular Java management tools from these web
containers to handle the Rails application. As you saw in the last chapter, it??™s easy to add even
more support for management to the Rails application.
The DSL in the war.rb file can be done in two different ways, but I??™m just going to
describe the recommended way here.
CHAPTER 11 ?– DEPLOYMENT 207
war_file FILENAME
By default, the WAR file generated for a Rails application will be named after the Rails application
in question. In some cases, this is not optimal. This parameter allows you to easily change
this file name:
war_file 'mephisto123.war'
exclude_files FILENAME
By default, GoldSpike tries to include almost all the files in a Rails directory inside the WAR
file.
Pages:
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315