Tuesday April 28, 2009
TOTD #79: Getting Started with Sinatra applications on JRuby and GlassFish Gem
![]() |
Sinatra
is a DSL for quickly creating web-applications in Ruby with minimal
effort. Like Rails and Merb, Sinatra is not an MVC framework and
basically follows a flat-file structure instead. The framework define
conventions such as location of static files and
views, bootstrap, dev/production/test environment variables, filters,
helpers, TDD, and much more. Read Getting Started
for complete details. Even though Sinatra is not a MVC framework but sinatra-gen
may be used to generate new Sinatra projects. GlassFish Gem can easily run Rails, Merb, Sinatra, and any other Ruby framework applications based upon Rack. TOTD #70 shows how to run Rails applications and TOTD #53 shows to run Merb applications. This TOTD will explain how to run a trivial Sinatra application. A later blog will describe how to plug a generic Rack-based framework. |
| ~/tools/jruby >./bin/jruby -S gem install
sinatra JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed sinatra-0.9.1.1 1 gem installed Installing ri documentation for sinatra-0.9.1.1... Installing RDoc documentation for sinatra-0.9.1.1... |
| require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end |
| ~/tools/jruby/samples/sinatra-sample
>../../bin/jruby
-S glassfish Log file /Users/arungupta/tools/jruby-1.2.0/samples/sinatra-sample/log/development.log does not exist. Creating a new one... Starting GlassFish server at: 192.168.1.145:3000 in development environment... Writing log messages to: /Users/arungupta/tools/jruby-1.2.0/samples/sinatra-sample/log/development.log. Press Ctrl+C to stop. |

Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Today's Page Hits: 1624
Total # blog entries: 1009