Sunday, November 20, 2011

How to build Ruby on Cygwin and setup Heroku

I like to use ruby that comes with Cygwin instead of the RubyInstaller for Windows, because the path it handles are more consistenly in Linux form. But the current Cygwin only comes with ruby-1.8.7, so to use ruby-1.9.3, I have to built it on Cygwin on my own. And when building ruby from source on Cygwin, you would also have to install gem on your own as well. Turns out there are few issues that you have to fix too. Here are the steps I got it working:

0. Ensure you have the typical Cygwin/Linux build tools (gcc, make, autoconf, libiconv, openssl and etc.)

1. Download source for the following:
  a) LibYAML 0.1.4 from http://pyyaml.org/wiki/LibYAML
  b) ruby-1.9.3-p0 source from http://ruby-lang.org
  c) rubygems-1.8.11 from http://rubygems.org


2. Unzip/tar them all in /tmp
  a) $ cd /tmp/yaml-0.1.4 
     $ ./configure && make && make install

  b) $ cd /tmp/ruby-1.9.3-p0/ext/openssl
     $ ruby extconf.rb
     $ make && make install

  c) $ cd /tmp/ruby-1.9.3-p0
     $ export CPPFLAGS=-I/usr/local/include
     $ export LDFLAGS=-L/usr/local/lib    
     $ ./configure && make && make install

  e) $ cd /tmp/rubygems-1.8.11
     $ ruby setup.rb

With these completed, you may now install Heroku client tool as ruby gem:
  c) $ gem install heroku
You would also need Git to successful push and deploy application to Heroku, but you can get Cygwin 'git' package if you haven't already done so.

NOTE: FYI, all the user built applications are usually install into /usr/local directory, while those system (comes with cygwin packages) are in /usr.

Monday, November 7, 2011

MySchedule-2.3.0 release is out

MySchedule is a web application that let you manage and run Quartz in a servlet container. You can get Quartz running and start exploring by simply dropping the war file into a web server such as Tomcat. 

Here is a short list of what's in this release: 
* Use myschedule-2.3.0 to manage Quartz-2.x 
* Use myschedule-1.6.0 to manage Quartz-1.8.x 
* Removed all unnecessary dependencies, and making the war file tiny (~ 3MB) 
* Support any Java ScriptEngine, and many examples are provided for you to script and manage the scheduler. 
* There is an independent quartz-extra jar that you may use outside of webapp, and it has been backported consistently to 1.x version as well. 
* Documentation is available on the project site. 

Try it out and let me know what you think. 

http://code.google.com/p/myschedule 

Enjoy!