Sunday May 04, 2008
GlassFish v3 Gem 0.2.0 released
A newer version of GlassFish
v3 Gem for Ruby
on Rails is now available.
What's new ?
| ~/testbed/jruby-1.1.1
>bin/jruby -S gem
list glassfish *** LOCAL GEMS *** glassfish (0.1.2) |
| ~/testbed/jruby-1.1.1
>bin/jruby -S gem
uninstall
glassfish Successfully uninstalled glassfish-0.1.2-universal-java Remove executables: glassfish_rails, asadmin, asadmin.bat in addition to the gem? [Yn] y Removing glassfish_rails Removing asadmin Removing asadmin.bat |
| ~/testbed/jruby-1.1.1
>bin/jruby -S gem
install glassfish JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Successfully installed glassfish-0.2.0-universal-java 1 gem installed |
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Tuesday April 08, 2008
JRuby 1.1 released - ready for production!
JRuby 1.1 is released
and ready for production use today. You can unleash the potential in 3
simple steps - download,
unzip & get
started. Here is a quote from the announcement:
more and more reports of
applications exceeding Ruby 1.8.6 performance; we are even beating Ruby
1.9 in some microbenchmarks
This is validated by 1
(Oct 2007), 2
(Nov 2007), 3
(Feb 2008), 4
(Feb 2008) and many other hidden/unknown reports. You can easily
configure JRuby 1.1 as the platform of your choice in NetBeans 6.1 as
described in TOTD
#27.
Now, match this blazing performance of JRuby with GlassFish
v3 gem (only 2.4 Mb) which provides a superior
solution for developing and deploying Rails application. The
main reasons for using GlassFish instead of WEBrick/Mongrel/LightTPD
are:
| ~/testbed/jruby-1.1
>bin/jruby -S gem
install glassfish JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL Updating metadata for 93 gems from http://gems.rubyforge.org ............................................................................................. complete Successfully installed glassfish-0.1.2-universal-java 1 gem installed |
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Monday March 24, 2008
JRuby 1.1 RC3 released - Last chance to file bugs
JRuby
1.1 RC3 (third and final release candidate) was released
last week. The highlights are:
dhcp64-134-213-159:jruby-1.1RC3
arungupta$ bin/jruby -S gem install glassfish |
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Thursday March 13, 2008
GlassFish v3 gem 0.1.2 released
Pramod announced the release of GlassFish
v3 Gem ver
0.1.2. The focus of this release is bugfixes:
Macintosh-187:jruby-1.1RC2
arungupta$ bin/jruby -S gem list
-d glassfish |
You can update to the most recent version by giving the command:Macintosh-187:jruby-1.1RC2
arungupta$ bin/jruby -S gem
update glassfish |
Macintosh-187:jruby-1.1RC2
arungupta$ bin/jruby -S gem list
-d glassfish |
bin/jruby
-S gem uninstall GlassFish |
Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Tuesday March 11, 2008
BitNami's JRubyStack = JRuby + Rails + GlassFish Gem + MySQL all bundled together
BitNami provides easy-to-use, integrated and multiplatform install bundles for different open source apps. They released JRubyStack last week which includes JRuby 1.1 RC2, Rails 2.0.2, GlassFish v3 Gem 0.1.1, MySQL 5.0.45 and some other miscellaneous components. The components mentioned here are all you need to get started with hosting your JRuby-on-Rails applications on GlassFish. Refer to release notes for more details.
The steps below walks you through installation of JRubyStack. It shows how this stack provides an integrated and ready-to-use bundle for hosting your applications on GlassFish:



Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup
run
INFO: Init service :
com.sun.enterprise.v3.services.impl.CmdLineParamProcessor@1d9e5ad
Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Init service : com.sun.enterprise.v3.server.SystemTasks@33c3e6
Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Init service :
com.sun.enterprise.v3.services.impl.LogManagerService@1b70f9e
Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Init service : com.sun.enterprise.v3.services.impl.HouseKeeper@666d83
Mar 10, 2008 2:49:26 PM
com.sun.enterprise.v3.services.impl.DeploymentService postConstruct
INFO: Supported containers : web,jruby,phobos
Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Startup service : Deployment
Mar 10, 2008 2:49:26 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Startup service :
org.glassfish.deployment.autodeploy.AutoDeployService@15925c0
Mar 10, 2008 2:49:27 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
<init>
INFO: Listening on port 3000
Mar 10, 2008 2:49:27 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
<init>
INFO: Listening on port 3131
Mar 10, 2008 2:49:27 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
<init>
INFO: Listening on port 3838
Mar 10, 2008 2:49:27 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Startup service :
com.sun.enterprise.v3.services.impl.GrizzlyService@eccfe7
Mar 10, 2008 2:49:28 PM com.sun.grizzly.standalone.StaticResourcesAdapter
<init>
INFO: New Servicing page from: C:\Users\Arun Gupta\BitNami JRubyStack
projects\jrubystack\public
Mar 10, 2008 2:49:28 PM com.sun.enterprise.rails.RailsDeployer load
INFO: Loading application . at /
Starting Rails instances
Mar 10, 2008 2:49:58 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
INFO: Rails instance instantiation took : 30451ms
Mar 10, 2008 2:49:58 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Startup service : Application Loader
Mar 10, 2008 2:49:58 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Glassfish v3 started in 32229 msNow you have a template app that can be used to experiment with different features of GlassFish Gem. A similar bundle can be easily hand-crafted using the steps described here.
More details about GlassFish and JRuby can be found @
GlassFish wiki
and JRuby wiki.
Help us test your application on the v3 gem and file issues in JIRA
or GlassFish
Issue Tracker.
Please use the gem and send us feedback on
GlassFish forums,
dev@glassfish or
gem mailing list.
Technorati: bitnami jrubystack jruby ruby rubyonrails glassfish v3 gem
Posted by Arun Gupta in web2.0 | Comments[0]
|
|
|
|
|
Wednesday February 20, 2008
TOTD #28: Getting Started with Rails 2.0 Scaffold
Rails
2.0 changes the way Scaffold
works. This blog walks you through the steps to create a simple CRUD
application using Scaffold in Rails 2.0.
jruby -S gem install railscd samples; mkdir rails; cd rails
jruby -S rails books -d mysqlsudo /usr/local/mysql/bin/mysqld_safe --consolecd books
jruby -S rake db:create
db:create:all |
Create all the databases (_Development, _Test, _Production) |
db:drop |
Drops your database |
db:reset |
Drop and Re-create your database, including migrations |
jruby script/generate scaffold book title:string author:string
isbn:string description:text
exists
app/models/
exists
app/controllers/
exists
app/helpers/
create
app/views/books
exists
app/views/layouts/
exists
test/functional/
exists
test/unit/
create
app/views/books/index.html.erb
create
app/views/books/show.html.erb
create
app/views/books/new.html.erb
create
app/views/books/edit.html.erb
create
app/views/layouts/books.html.erb
create
public/stylesheets/scaffold.css
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/book.rb
create test/unit/book_test.rb
create test/fixtures/books.yml
create db/migrate
create db/migrate/001_create_books.rb
create
app/controllers/books_controller.rb
create
test/functional/books_controller_test.rb
create
app/helpers/books_helper.rb
route
map.resources :booksdb/migrate/001_create_books.rb"
migration which looks like:class CreateBooks < ActiveRecord::Migration
def self.up
create_table :books do |t|
t.string :title
t.string :author
t.string :isbn
t.text :description
t.timestamps
end
end
def self.down
drop_table :books
end
endjruby -S rake db:migrate
jruby script/serverhttp://localhost:3000/books"
and looks like:


Posted by Arun Gupta in web2.0 | Comments[5]
|
|
|
|
|
Saturday February 16, 2008
GlassFish v3 gem on JRuby 1.1 RC2
JRuby 1.1 RC2 was released earlier
today an GlassFish
v3 gem works like a charm on it :)
Read the complete announcement here.
The key features of RC2 are:
bin/jruby -S gem install
glassfish
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed glassfish-0.1.1-universal-java
1 gem installedjruby -S glassfish_rails hello

Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Thursday February 14, 2008
GlassFish v3 Gem - 0.1.1 available
Pramod released
an updated version 0.1.1 of the JRuby
GlassFish v3 gem.
What's New ? - Mainly
alignment with Rails convention
http://localhost:3000/home/index"
instead of "http://localhost:8080/temp/home/index".jruby -S glassfish_rails temp -n 2bin/jruby -S gem uninstall GlassFish
Successfully uninstalled GlassFish-0.1.0-java
Remove executables and scripts for
'glassfish_rails, asadmin, asadmin.bat' in addition to the gem?
[Yn] Y
Removing glassfish_rails
Removing asadmin
Removing asadmin.batbin/jruby -S gem install glassfish
JRuby limited openssl loaded. gem install jruby-openssl for full
support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Successfully installed glassfish-0.1.1-universal-java
1 gem installedbin/jruby -S gem list
*** LOCAL GEMS ***
actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
glassfish (0.1.1)
rails (2.0.2)
rake (0.8.1)
sources (0.0.1)Posted by Arun Gupta in web2.0 | Comments[7]
|
|
|
|
|
Monday November 19, 2007
TOTD #18: How to Build The GlassFish v3 Gem for JRuby ?
Jerome posted the instructions to build GlassFish v3 Gem for JRuby - very simple and easy. A binary version of Gem is available here.
JRUBY_HOME). Make sure
JRUBY_HOME/bin is in your path.As explained in
Jerome's
entry, you can check out complete GlassFish v3 workspace or just the
Gem code. Here is how you'll check out only the Gem code on a Windows
machine using Tigris Subversion client:

And after the check out is complete, you'll see:

mvn install[INFO] (in
C:/workspaces/glassfish/gem/target/dependency/glassfish)
[WARNING] mkdir -p pkg
[INFO] Successfully built RubyGem
[INFO] Name: GlassFish
[WARNING] mv GlassFish-10.0.0-java.gem pkg/GlassFish-10.0.0-java.gem
[INFO] Version: 10.0.0
[INFO] File: GlassFish-10.0.0-java.gem
[INFO] [install:install]
[INFO] Installing
C:\workspaces\glassfish\gem\target\gem-10.0-SNAPSHOT.jar to C:\Users\Arun
Gupta\.m2\repository\org\glassfish\distributions\gem\10.0-SNAPSHOT\gem-10.0-SNAPSHOT.jar
[INFO] [install:install-file {execution: install-gem}]
[INFO] Installing
C:\workspaces\glassfish\gem\target\dependency\glassfish\pkg\GlassFish-10.0.0-java.gem
to C:\Users\Arun
Gupta\.m2\repository\org\glassfish\distributions\GlassFish-Gem\10.0-SNAPSHOT\GlassFish-Gem-10.0-SNAPSHOT.gem
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 minutes 2 seconds
[INFO] Finished at: Fri Nov 16 17:56:12 PST 2007
[INFO] Final Memory: 11M/20M
[INFO]
------------------------------------------------------------------------
The Gem is available in target\dependency\glassfish\pkg
directory.cd target\dependency\glassfish\pkgC:\testbed\ruby\jruby-1.0.2\bin\jruby -S gem install
GlassFish-10.0.0-java.gem
Successfully installed GlassFish, version 10.0.0And use it!
Please leave suggestions on other TOTD that you'd like to see. A complete archive is available here.
Technorati: totd v3 jruby ruby rubyonrails glassfish gem jrubyonglassfish
Posted by Arun Gupta in Finance | Comments[2]
|
|
|
|
|
Thursday November 15, 2007
Mephisto with GlassFish v3 Gem
In an Earlier Post, I described how Mephisto (a popular web publishing system based on Ruby on Rails) can be deployed on GlassFish V3. Both JRuby and GlassFish has matured since then and this post will provide the updated instructions to deploy Mephisto using GlassFish v3 Gem.
Here are the exact steps:
JRUBY_HOME/bin' in your environment PATH.C:\workspaces\jruby-trunk>bin\jruby -S gem install rails
--include-dependencies --no-ri --no-rdoc
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.2.5
Successfully installed activesupport-1.4.4
Successfully installed activerecord-1.15.5
Successfully installed actionpack-1.13.5
Successfully installed actionmailer-1.3.5
Successfully installed actionwebservice-1.2.5C:\workspaces\jruby-trunk>bin\jruby -S gem install
activerecord-jdbc -y --no-rdoc --no-ri
Need to update 1 gems from http://gems.rubyforge.org
.
complete
Successfully installed ActiveRecord-JDBC-0.5mysqld-nt --user root --console'
in MYSQL_HOME/bin directory on Windows or './bin/mysqld_safe'
from MYSQL_HOME directory on Unix flavors.C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqladmin --u root
create mephisto_development
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all on mephisto_development.* to arun@localhost identified
by 'noway';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
ByeMEPHISTO_HOME/config/database.example.yml'
to 'MEPHISTO_HOME/config/database.yml'. There is no need to
specify the JDBC adapter
ActiveRecord 0.5 onwards and that allows to use the default
database configuration file.C:\testbed\mephisto-0.7.3>jruby -S rake db:bootstrap -J-DRAILS_ENV=development
(in C:/testbed/mephisto-0.7.3)
mkdir -p C:/testbed/mephisto-0.7.3/config/../log
-- create_table("assets", {:force=>true})
-> 0.3330s
-- create_table("assigned_sections", {:force=>true})
-> 0.2000s
-- create_table("cached_pages", {:force=>true})
-> 0.2980s
-- create_table("content_versions", {:force=>true})
-> 0.2130s
-- create_table("contents", {:force=>true})
-> 0.2190s
-- create_table("events", {:force=>true})
-> 0.2680s
-- create_table("memberships", {:force=>true})
-> 0.1890s
-- create_table("sections", {:force=>true})
-> 0.1500s
-- create_table("sessions", {:force=>true})
-> 0.1200s
-- add_index("sessions", ["session_id"], {:name=>"sessions_session_id_index"})
-> 0.3220s
-- create_table("sites", {:force=>true})
-> 1.1240s
-- add_index("sites", ["host"], {:name=>"index_sites_on_host"})
-> 0.3490s
-- create_table("taggings", {:force=>true})
-> 0.1950s
-- create_table("tags", {:force=>true})
-> 0.1840s
-- create_table("users", {:force=>true})
-> 0.2750s
-- initialize_schema_information()
-> 0.2740s
-- columns("schema_info")
-> 0.0170s
copied default theme to C:/testbed/mephisto-0.7.3/config/../themes/site-1...
================================================================================
Thank you for trying out Mephisto 0.7.3: Noh-Varr Edition!
Now you can start the application with script/server, visit
http://mydomain.com/admin, and log in with admin / test.
For help, visit the following:
Official Mephisto Site - http://mephistoblog.com
The Mephisto Community Wiki - http://mephisto.stikipad.com/
The Mephisto Google Group - http://groups.google.com/group/MephistoBlogC:\testbed>\workspaces\jruby-trunk\bin\jruby -S glassfish_rails
mephisto-0.7.3
And that shows the following output in the console:
Nov 14, 2007 6:37:51 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
postConstruct
INFO: Listening on port 8080
Nov 14, 2007 6:37:51 PM
com.sun.enterprise.v3.services.impl.DeploymentService postConstruct
INFO: Supported containers : php,phobos,jruby,web
Nov 14, 2007 6:37:52 PM com.sun.grizzly.standalone.StaticResourcesAdapter
<init>
INFO: New Servicing page from: C:\testbed\mephisto-0.7.3\public
Nov 14, 2007 6:38:00 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Glassfish v3 started in 9054 mshttp://localhost:8080/mephisto-0.7.3

Nov 14, 2007 6:24:08 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO:
Processing MephistoController#dispatch (for 127.0.0.1 at 2007-11-14
18:24:08) [GET]
Nov 14, 2007 6:24:08 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Parameters: {"action"=>"dispatch", "controller"=>"mephisto",
"path"=>[]}
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mSQL (0.001000)←[0m ←[0;1mSET SQL_AUTO_IS_NULL=0←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;35;1mSite Columns (0.046000)←[0m ←[0mSHOW FIELDS FROM sites←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mSite Load (0.010000)←[0m ←[0;1mSELECT * FROM sites WHERE (sites.`host`
= 'localhost') LIMIT 1←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;35;1mSite Load (0.017000)←[0m ←[0mSELECT * FROM sites ORDER BY id
LIMIT 1←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mSection Columns (0.010000)←[0m ←[0;1mSHOW FIELDS FROM
sections←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;35;1mSection Load (0.005000)←[0m ←[0mSELECT * FROM sections WHERE
(sections.site_id =1) AND (sections.`path` = '') LIMIT 1←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mArticle Columns (0.024000)←[0m ←[0;1mSHOW FIELDS FROM
contents←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;35;1mUser Columns (0.013000)←[0m ←[0mSHOW FIELDS FROM users←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mArticle Load Including Associations (0.027000)←[0m
←[0;1mSELECT contents.`id` AS t0_r0, contents.`article_id` AS t0_r1,
contents.`user_id` AS t0_r2, contents.`title` AS t0_r3, contents.`permalink`
AS t0_r4, contents.`excerpt` AS t0_r5, contents.`body` AS t0_r6,
contents.`excerpt_html` AS t0_r7, contents.`body_html` AS t0_r8,
contents.`created_at` AS t0_r9, contents.`updated_at` AS t0_r10,
contents.`published_at` AS t0_r11, contents.`type` AS t0_r12,
contents.`author` AS t0_r13, contents.`author_url` AS t0_r14,
contents.`author_email` AS t0_r15, contents.`author_ip` AS t0_r16,
contents.`comments_count` AS t0_r17, contents.`updater_id` AS t0_r18,
contents.`version` AS t0_r19, contents.`site_id` AS t0_r20,
contents.`approved` AS t0_r21, contents.`comment_age` AS t0_r22,
contents.`filter` AS t0_r23, contents.`user_agent` AS t0_r24,
contents.`referrer` AS t0_r25, users.`id` AS t1_r0, users.`login` AS t1_r1,
users.`email` AS t1_r2, users.`crypted_password` AS t1_r3, users.`salt` AS
t1_r4, users.`activation_code` AS t1_r5, users.`activated_at` AS t1_r6,
users.`created_at` AS t1_r7, users.`updated_at` AS t1_r8, users.`deleted_at`
AS t1_r9, users.`token` AS t1_r10, users.`token_expires_at` AS t1_r11,
users.`filter` AS t1_r12, users.`admin` AS t1_r13 FROM contents LEFT O
UTER JOIN users ON users.id = contents.user_id INNER JOIN assigned_sections
ON contents.id = assigned_sections.article_id WHERE ((assigned_sections.section_id
= 1)) AND (contents.published_at <= '2007-11-15 02:24:09' AND
contents.published_at IS NOT NULL) AND ( (contents.`type` = 'Article' ) )
ORDER BY contents.published_at desc LIMIT 15←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;35;1mSection Load (0.009000)←[0m ←[0mSELECT * FROM sections WHERE
(sections.site_id =1) ORDER BY position←[0m
Nov 14, 2007 6:24:09 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Completed in 1.12200 (0 reqs/sec) | Rendering: 0.00100 (0%) | DB:
0.16200 (14%) | 200 OK [http://localhost/mephisto-0.7.3]
Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO:
Processing AssetsController#show (for 127.0.0.1 at 2007-11-14 18:24:11)
[GET]
Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Parameters: {"ext"=>"css", "dir"=>"stylesheets", "action"=>"show",
"controller"=>"assets", "path"=>"main"}
Nov 14, 2007 6:24:11 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: ←[4;36;1mSite Columns (0.030000)←[0m ←[0;1mSHOW FIELDS FROM sites←[0m
Nov 14, 2007 6:24:11 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: ←[4;35;1mSite Load (0.018000)←[0m ←[0mSELECT * FROM sites WHERE (sites.`host`
= 'localhost') LIMIT 1←[0m
Nov 14, 2007 6:24:11 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: ←[4;36;1mSite Load (0.011000)←[0m ←[0;1mSELECT * FROM sites ORDER BY
id LIMIT 1←[0m
Nov 14, 2007 6:24:12 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: Completed in 0.33500 (2 reqs/sec) | Rendering: 0.00100 (0%) | DB:
0.05900 (17%) | 200 OK [http://localhost/mephisto-0.7.3/stylesheets/main.css]
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO:
Processing AssetsController#show (for 127.0.0.1 at 2007-11-14 18:24:14)
[GET]
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: Parameters: {"ext"=>"png", "dir"=>"images", "action"=>"show",
"controller"=>"assets", "path"=>"bg"}
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: ←[4;35;1mSite Columns (0.009000)←[0m ←[0mSHOW FIELDS FROM sites←[0m
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: ←[4;36;1mSite Load (0.017000)←[0m ←[0;1mSELECT * FROM sites WHERE (sites.`host`
= 'localhost') LIMIT 1←[0m
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: ←[4;35;1mSite Load (0.007000)←[0m ←[0mSELECT * FROM sites ORDER BY id
LIMIT 1←[0m
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: Sending data bg.png
Nov 14, 2007 6:24:14 PM sun.reflect.GeneratedMethodAccessor5 invoke
INFO: Completed in 0.27900 (3 reqs/sec) | Rendering: 0.00000 (0%) | DB:
0.03300 (11%) | 200 OK [http://localhost/mephisto-0.7.3/images/bg.png]C:\testbed\mephisto-0.7.3>\testbed\ruby\jruby-1.0.2\bin\jruby
script\server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-11-14 18:17:57] INFO WEBrick 1.3.1
[2007-11-14 18:17:57] INFO ruby 1.8.5 (2007-11-01) [java]
[2007-11-14 18:17:58] INFO WEBrick::HTTPServer#start: pid=11245030 port=3000
127.0.0.1 - - [14/Nov/2007:18:18:11 PST] "GET / HTTP/1.1" 200 1326
In this case, Mephisto gets deployed at http://localhost:3000
and WEBrick console shows the following:
- -> /
127.0.0.1 - - [14/Nov/2007:18:18:14 PST] "GET /stylesheets/main.css
HTTP/1.1" 200 3168
http://localhost:3000/ -> /stylesheets/main.css
127.0.0.1 - - [14/Nov/2007:18:18:17 PST] "GET /favicon.ico HTTP/1.1" 200 0
- -> /favicon.ico
127.0.0.1 - - [14/Nov/2007:18:18:16 PST] "GET /images/bg.png HTTP/1.1" 200
142
http://localhost:3000/stylesheets/main.css -> /images/bg.pngThis shows how a popular Ruby application can be deployed on WEBrick or GlassFish V3 Gem without any change.
Let us know if you have tried other Rails applications on GlassFish v3 by leaving a comment.
Technorati: glassfish mephisto rubyonrails ror jrubyonglassfish v3 gem ruby jruby
Posted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Friday November 09, 2007
JRuby 1.0.2 released - Improved Windows experience and Rails 1.2.5 support
JRuby 1.0.2 was released last week.
A total of 99 issues were fixed but I'm particularly excited about JRUBY-1347, JRUBY-1350, JRUBY-1401 and JRUBY-1410. These are some issues that I faced (1347 here, 1350 here, 1401 here, 1410 here) on my primary development machine - Windows.
Here is the status report:
On Windows only, the latest Rails gem (1.2.5) is now working with stable release of JRuby (1.0.2 as of today).
On Windows only, GlassFish v3 gem does not work with JRuby 1.0.2 but works with the JRuby trunk (JRUBY-1549). The gem works correctly on Solaris and Mac.
JRuby 1.0.2 bundles will be available on GlassFish Update Center soon.
Now the details.
Here is the command sequence for creating and hosting a trivial Hello World on WEBrick:
Install Rails
C:\testbed\ruby\jruby-1.0.2>bin\jruby -S gem install rails
--include-dependencies --no-ri --no-rdoc
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.2.5
Successfully installed activesupport-1.4.4
Successfully installed activerecord-1.15.5
Successfully installed actionpack-1.13.5
Successfully installed actionmailer-1.3.5
Successfully installed actionwebservice-1.2.5
Create a template application
C:\workarea\samples\rails>\testbed\ruby\jruby-1.0.2\bin\jruby -S rails
hello
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create components
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create script/process
create test/fixtures
create test/functional
create test/integration
create test/mocks/development
create test/mocks/test
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application.rb
create app/helpers/application_helper.rb
create test/test_helper.rb
create config/database.yml
create config/routes.rb
create public/.htaccess
create config/boot.rb
create config/environment.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/breakpointer
create script/console
create script/destroy
create script/generate
create script/performance/benchmarker
create script/performance/profiler
create script/process/reaper
create script/process/spawner
create script/process/inspector
create script/runner
create script/server
create script/plugin
create public/dispatch.rb
create public/dispatch.cgi
create public/dispatch.fcgi
create public/404.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
Add a controller
C:\workarea\samples\rails>cd hello
C:\workarea\samples\rails\hello>\testbed\ruby\jruby-1.0.2\bin\jruby
script\generate controller say hello
exists app/controllers/
exists app/helpers/
create app/views/say
exists test/functional/
create app/controllers/say_controller.rb
create test/functional/say_controller_test.rb
create app/helpers/say_helper.rb
create app/views/say/hello.rhtml
Edit Controller
C:\workarea\samples\rails\hello>vim app\controllers\say_controller.rb
Add @hello_string = "Hello from 1.0.2" in
hello helper. The updated file looks like:
class SayController < ApplicationController
def hello
@hello_string = "Hello from 1.0.2"
end
end
Edit View
C:\workarea\samples\rails\hello>vim app\views\say\hello.rhtml
and add <%= @hello_string %> as the last line.
The updated file looks like:
<h1>Say#hello</h1>
<p>Find me in app/views/say/hello.rhtml</p>
<%= @hello_string %>
Start WEBrick and view the page
http://localhost:3000/say/hello in a browser window:
C:\workarea\samples\rails\hello>\testbed\ruby\jruby-1.0.2\bin\jruby
script\server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-11-07 17:22:01] INFO WEBrick 1.3.1
[2007-11-07 17:22:01] INFO ruby 1.8.5 (2007-11-01) [java]
[2007-11-07 17:22:01] INFO WEBrick::HTTPServer#start: pid=11245030 port=3000
127.0.0.1 - - [07/Nov/2007:17:22:38 PST] "GET /say/hello HTTP/1.1" 200 81
- -> /say/hello
The GlassFish v3 Gem does not work with JRuby 1.0.2 (JRUBY-1549) on Windows. It works very well on Solaris and Mac. For Windows, you need to use the JRuby trunk (checkout and build):
After you've built the JRuby trunk, you can create a similar new application and run it on GlassFish v3 gem as:
Download and
Install the gem
C:\workspaces\jruby-trunk>bin\jruby -S gem install
glassfish-gem-10.0-SNAPSHOT.gem
Successfully installed GlassFish, version 10.0.0
Start GlassFish v3 and view the page
http://localhost:8080/hello/say/hello:
C:\workarea\samples\rails>\workspaces\jruby-trunk\bin\jruby -S
glassfish_rails hello
Nov 8, 2007 2:39:07 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
postConstruct
INFO: Listening on port 8080
Nov 8, 2007 2:39:08 PM com.sun.enterprise.v3.services.impl.DeploymentService
postConstruct
INFO: Supported containers : php,phobos,jruby,web
Nov 8, 2007 2:39:08 PM com.sun.grizzly.standalone.StaticResourcesAdapter
<init>
INFO: New Servicing page from: C:\workarea\samples\rails\hello\public
Nov 8, 2007 2:39:15 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Glassfish v3 started in 7588 ms
Nov 8, 2007 2:39:27 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO:
Processing SayController#hello (for 127.0.0.1 at 2007-11-08 14:39:27) [GET]
Nov 8, 2007 2:39:27 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Session ID: 46e3279ab4f2d776b4d76010cc7b38af
Nov 8, 2007 2:39:27 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Parameters: {"action"=>"hello", "controller"=>"say"}
Nov 8, 2007 2:39:27 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Rendering say/hello
Nov 8, 2007 2:39:27 PM sun.reflect.NativeMethodAccessorImpl invoke0
INFO: Completed in 0.01100 (90 reqs/sec) | Rendering: 0.00900 (81%) | 200 OK
[http://localhost/hello/say/hello]
A comprehensive list of JRuby on GlassFish documentation is available here.
Technorati: jrubyonglassfish jruby glassfish windows rubyonrails v3 gem ruby
Posted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Friday September 14, 2007
Announcing GlassFish Gem for Rails
Jerome has been working on GlassFish gem for Rails. Read the interesting discussion on dev@glassfish. This blog announces a technology preview of this gem and describes the steps to try it out.
In JRUBY_HOME\bin directory, install Rails plugin using the following command:
jruby -S gem install rails -y --no-rdoc
--no-ri
The output of the command looks like:
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.2.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
JRUBY_HOME\bin\_jrubyvars.bat"
and replacefor /r "%JRUBY_HOME%\lib" %%i in (*.jar) do @call "%~dp0_jrubysetcp"
%%ifor %%i in ("%JRUBY_HOME%\lib"\*.jar) do @call "%~dp0_jrubysetcp" %%iThe input line is too long.
:gotCP
was unexpected at this time.Only on Macintosh: "JRUBY_HOME\bin\glassfish_rails"
script executable permissions need to be set explicitly. This is filed as
bug #1348.
Install the GlassFish gem using the command:
c:\Downloads>\jruby-1.0.1\bin\gem install
glassfish-gem-10.0-SNAPSHOT.gem
The output of the command looks like:
Successfully installed GlassFish, version 10.0.0
Notice, you need to invoke this command from the directory where the gem was
downloaded.
Create a new rails app using the following command:
%JRUBY_HOME%\bin\jruby -S rails hello
The output of the command looks like:
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create components
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create script/process
create test/fixtures
create test/functional
create test/integration
create test/mocks/development
create test/mocks/test
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application.rb
create app/helpers/application_helper.rb
create test/test_helper.rb
create config/database.yml
create config/routes.rb
create public/.htaccess
create config/boot.rb
create config/environment.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/breakpointer
create script/console
create script/destroy
create script/generate
create script/performance/benchmarker
create script/performance/profiler
create script/process/reaper
create script/process/spawner
create script/process/inspector
create script/runner
create script/server
create script/plugin
create public/dispatch.rb
create public/dispatch.cgi
create public/dispatch.fcgi
create public/404.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
Start GlassFish for this newly created app using the
following command:
%JRUBY_HOME%\bin\jruby -S glassfish_rails
hello
You need to invoke the command from outside the application
directory instead of the natural way (script\server start).
This will be fixed in the future builds. The output of the command looks
like:
Sep 13, 2007 1:32:42 PM com.sun.enterprise.v3.services.impl.GrizzlyAdapter
postConstruct
INFO: Listening on port 8080
Sep 13, 2007 1:32:42 PM
com.sun.enterprise.v3.services.impl.DeploymentService postConstruct
INFO: Supported containers : jruby,web,php,phobos
Sep 13, 2007 1:32:43 PM com.sun.grizzly.standalone.StaticResourcesAdapter
<init>
INFO: New Servicing page from: C:\workarea\samples\rails\hello\public
C:/jruby-1.0.1/lib/ruby/gems/1.8/gems/actionmailer-1.3.3/lib/action_mail
er.rb:49 warning: already initialized constant MAX_LINE_LEN
Sep 13, 2007 1:32:51 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: Glassfish v3 started in 8996 ms
Now you can view the default GlassFish web page at "http://localhost:8080".
This verifies the basic installation of the GlassFish gem. Lets add a simple controller to our application.
jruby script\generate controller say helloThe output of the command looks like:
exists app/controllers/
exists app/helpers/
create app/views/say
exists test/functional/
create app/controllers/say_controller.rb
create test/functional/say_controller_test.rb
create app/helpers/say_helper.rb
create app/views/say/hello.rhtml
hello\app\views\say directory, edit "hello.rhtml"
such that it looks like:<h1>Say#hello</h1>
<p>Find me in app/views/say/hello.rhtml</p>
<%= @hello_string %>hello\app\controllers directory, edit "say_controller.rb"
such that it looks like:class SayController < ApplicationController
def hello
@hello_string = "Hello from Controller!"
end
end
http://localhost:8080/hello/say/hello". This is hosted using GlassFish. Of course, the same application can be
deployed on WEBrick by giving the command:
jruby script\server webrick start
Try your applications on GlasFish gem and let us know by leaving a comment on this blog or sending an email to users@glassfish or posting to GlassFish forum.
You can also download GlassFish V3 standalone builds from here. The instructions to deploy a Rails application on GlassFish V3 are available here and on V2 here.
Technorati: jruby ruby rubyonrails glassfish jrubyonglassfish gem v3
Posted by Arun Gupta in web2.0 | Comments[22]
|
|
|
|
|
Today's Page Hits: 1688
Total # blog entries: 1009