Friday November 14, 2008
TOTD #52: Getting Started with Merb using GlassFish Gem
GlassFish
Gem 0.9.0 was recently
released.
It can run any Rack-compatible
framework such as Rails
and Merb.
Support for another Rack-based framework Sinatra will
be released in the near future. The gem is even extensible and
allows to plug any of your favorite Ruby framework using -apptype
switch (more on this in a future blog). This blog shows how to install
the gem and use it for running a Merb application.

| ~/tools/jruby-1.1.5 >gem install glassfish rack JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed glassfish-0.9.0-universal-java Successfully installed rack-0.4.0 2 gems installed Installing ri documentation for glassfish-0.9.0-universal-java... Installing ri documentation for rack-0.4.0... Installing RDoc documentation for glassfish-0.9.0-universal-java... Installing RDoc documentation for rack-0.4.0... |
| ~/tools/jruby-1.1.5 >glassfish -h Synopsis -------- glassfish: GlassFish v3 server for rails, merb, sintra applications Usage: ------ glassfish [OPTION] APPLICATION_PATH -h, --help: show help -c, --contextroot PATH: change the context root (default: '/') -p, --port PORT: change server port (default: 3000) -e, --environment ENV: change rails environment (default: development) -n --runtimes NUMBER: Number of JRuby runtimes to crete initially --runtimes-min NUMBER: Minimum JRuby runtimes to crete --runtimes-max NUMBER: Maximum number of JRuby runtimes to crete APPLICATION_PATH (optional): Path to the application to be run (default: current). |
| ~/tools/jruby-1.1.5
>gem install
merb-core merb-more merb_activerecord JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed extlib-0.9.8 Successfully installed abstract-1.0.0 Successfully installed erubis-2.6.2 Successfully installed json_pure-1.1.3 Successfully installed rack-0.4.0 Successfully installed mime-types-1.15 Successfully installed thor-0.9.8 Successfully installed merb-core-1.0 Successfully installed ZenTest-3.11.0 Successfully installed RubyInline-3.8.1 Successfully installed sexp_processor-3.0.0 Successfully installed ParseTree-3.0.2 Successfully installed ruby2ruby-1.2.1 Successfully installed merb-action-args-1.0 Successfully installed merb-assets-1.0 Successfully installed merb-slices-1.0 Successfully installed merb-auth-core-1.0 Successfully installed merb-auth-more-1.0 Successfully installed merb-auth-slice-password-1.0 Successfully installed merb-auth-1.0 Successfully installed merb-cache-1.0 Successfully installed merb-exceptions-1.0 Successfully installed highline-1.5.0 Successfully installed diff-lcs-1.1.2 Successfully installed templater-0.4.0 Successfully installed merb-gen-1.0 Successfully installed haml-2.0.4 Successfully installed merb-haml-1.0 Successfully installed merb-helpers-1.0 Successfully installed mailfactory-1.4.0 Successfully installed merb-mailer-1.0 Successfully installed merb-param-protection-1.0 Successfully installed addressable-1.0.4 Successfully installed data_objects-0.9.6 Successfully installed dm-core-0.9.6 Successfully installed dm-migrations-0.9.6 Successfully installed merb_datamapper-1.0 Successfully installed merb-more-1.0 Successfully installed merb_activerecord-0.9.13 39 gems installed Installing ri documentation for json_pure-1.1.3... Installing ri documentation for rack-0.4.0... Installing ri documentation for mime-types-1.15... . . . Installing RDoc documentation for dm-migrations-0.9.6... Installing RDoc documentation for merb_datamapper-1.0... Installing RDoc documentation for merb_activerecord-0.9.13... |
| ~/samples/jruby/merb >merb-gen core hello Generating with core generator: [ADDED] gems [ADDED] merb.thor [ADDED] .gitignore [ADDED] public/.htaccess [ADDED] doc/rdoc/generators/merb_generator.rb [ADDED] doc/rdoc/generators/template/merb/api_grease.js [ADDED] doc/rdoc/generators/template/merb/index.html.erb [ADDED] doc/rdoc/generators/template/merb/merb.css [ADDED] doc/rdoc/generators/template/merb/merb.rb [ADDED] doc/rdoc/generators/template/merb/merb_doc_styles.css [ADDED] doc/rdoc/generators/template/merb/prototype.js [ADDED] public/favicon.ico [ADDED] public/merb.fcgi [ADDED] public/robots.txt [ADDED] public/images/merb.jpg [ADDED] Rakefile [ADDED] app/controllers/application.rb [ADDED] app/controllers/exceptions.rb [ADDED] app/helpers/global_helpers.rb [ADDED] app/views/exceptions/not_acceptable.html.erb [ADDED] app/views/exceptions/not_found.html.erb [ADDED] autotest/discover.rb [ADDED] autotest/merb.rb [ADDED] autotest/merb_rspec.rb [ADDED] config/init.rb [ADDED] config/rack.rb [ADDED] config/router.rb [ADDED] config/environments/development.rb [ADDED] config/environments/production.rb [ADDED] config/environments/rake.rb [ADDED] config/environments/staging.rb [ADDED] config/environments/test.rb [ADDED] public/javascripts/application.js [ADDED] public/stylesheets/master.css [ADDED] spec [ADDED] app/views/layout/application.html.erb |
| ~/samples/jruby/merb/hello >merb-gen controller Runners Loading init file from /Users/arungupta/samples/jruby/merb/jruby-1.1.5/samples/merb/hello/config/init.rb Loading /Users/arungupta/samples/jruby/merb/jruby-1.1.5/samples/merb/hello/config/environments/development.rb Generating with controller generator: Loading init file from /Users/arungupta/samples/jruby/merb/jruby-1.1.5/samples/merb/hello/config/init.rb Loading /Users/arungupta/samples/jruby/merb/jruby-1.1.5/samples/merb/hello/config/environments/development.rb [ADDED] app/controllers/runners.rb [ADDED] app/views/runners/index.html.erb [ADDED] spec/requests/runners_spec.rb [ADDED] app/helpers/runners_helper.rb |
|
def index @message = "Miles to go ..." render end |



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