Aug 05

In previous article we have seen that how to start nailgun server,and use of nailgun in shortly.

Now in this article how to use nailgun using ruby application which directly/indirectly use java library or java application. You can start with nailgun manually as shown previous article and configure ng as per need.Or you can install nailgun plugin from github.

ruby script/plugin install git://github.com/amardaxini/nailgun.git

After installing plugin run rake command .

rake nailgun

By default nailgun start on localhost with port no is 2113.We can customise this options by adding following text to config/initializers/nailgun_config.rb file.

Nailgun::NailgunConfig.options =
  {
      :java_bin => path to java,
      :server_address =>"Server Address",
      :port_no=>"Port no"
  }

After configuration now we can start nailgun server using following command

  ruby script/nailgun start

It will start nailgun server on specified address and port. To add any class path using following command.

  Nailgun::NgCommand.ng_cp(absolute jar path/absolute class path)

To add alias of class name using following command.


Nailgun::NgCommand.ng_alias(alias name,class name)

To stop nailgun server

  ruby script/nailgun stop

I hope this will helps to start with nailgun by installing simply nailgun plugin. More you can read about nailgun.

Be Sociable, Share!

Leave a Reply

preload preload preload