JRuby, Rails, and the required Gems should already be installed, as described in Installing JRuby and Rails.
Download and install MySQL database server:
Configure the server according to the MySQL documentation, including entering a root password.
Start the MySQL server.
Install the JRuby activerecord-jdbcmysql-adapter gem, if necessary.
gem install activerecord-jdbcmysql-adapter
Modify the database.rake script for your Rails installation so it uses jdbcmysql rather than mysql.
For example, if using the version of JRuby and Rails installed through GlassFish Server Update Center on Solaris or Linux, the database.rake file is located in:
Change all instances of mysql with jdbcmysql, and then save the file.