Jan 30

I have to say.  JRuby on Rails is very cool.  It is so easy now to deploy to Tomcat and JBoss.   I tried and did it on both server and it ran like a champ.  Here is the steps (Mac OS X):’

  1. sudo port install jruby
  2.  sudo chmod a+w /opt/local/share/java/jruby/lib/ruby/gems/ and all the directory underneath it
  3.  sudo chmod a+w /opt/local/share/java/jruby/bin
  4.  jruby -S gem install rails mongrel jdbc-mysql activerecord-jdbcmysql-adapter activerecord-jdbc-adapter jruby-openssl warbler –no-rdoc –no-ri
  5. sudo port tomcat5  (or you can install jboss.  Just download and unpack it to a directory)
  6. jruby -S rails your_rails_project
  7. cd your_rails_project
  8. generate a simple model: jruby script/generate scaffold car model:string
  9. create a development database:my_own_development in mysql
  10. change config/database.yml:
  11. development:
    adapter: jdbcmysql
    database: my_own_devevelopment
    pool: 5
    timeout: 5000
    host: localhost
    username: root
    password:
  12. jruby rake db:migrate
  13.  jruby -S warble config
  14. change config/warble.rb file:
  15.        make sure:  config.gems += [”activerecord-jdbcmysql-adapter”, “jruby-openssl”,”activerecord-jdbc-adapter”,”jdbc-mysql”]  #include all the gems you need
  16.        make sure: config.webxml.rails.env = ENV[’RAILS_ENV’] || ‘production’ # point to the environment you want.  By default it is production
  17. make sure you are on your rails project’s root directory
  18. jruby -S warble war
  19. that will create war file like your_rails_project.war
  20. cp your_rails_project.war to your tomcat_home/webapps directory or your jboss_home/server/default/deploy directory
  21. start tomcat or start jboss
  22. go  http://localhost:8080/your_rails_project/ to check if your project has deployed.  To see the scaffold car go http://localhost:8080/your_rails_project/cars

One Response

  1. payday loans Says:

    I want to thank the blogger very much not only for this post but also for his all previous efforts. I found http://www.industryzero.com to be greatly interesting. I will be coming back to http://www.industryzero.com for more information.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.