Friday December 21, 2007
JRuby 1.0.3 + Rails 2.0 Hello World - Additional Steps Required
JRuby 1.0.3 was recently
released and so was Rails
2.0. I decided to try JRuby 1.0.3 + Rails 2.0 and realized
that a few additional steps (because of Rails 2.0) are required to get
a trivial Hello World
applcation up and running. Here are the steps:
~/samples/jruby arungupta$ jruby -S gem install rails
--include-dependencies --no-ri --no-rdoc
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-2.0.2
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2jruby -S rails --database mysql hello or
jruby -S rails -d mysql hello--database mysql
otherwise Rails 2.0 uses sqlite3
as the default database.
cd hello
jruby script/generate controller say hellovi app/controllers/say_controller.rb@hello_string = ""vi app/views/say/hello.html.erb
<%= @hello_string %>.html.erb
instead of .rhtml.sudo ./bin/mysqld_safesudo ./bin/mysqladmin create hello_developmentjruby script/serverHello World
application is deployed using JRuby 1.0.3 + Rails 2.0 and displays the
output in a browser window as:
Posted by Arun Gupta in web2.0 | Comments[4]
|
|
|
|
|
Today's Page Hits: 1872
Total # blog entries: 994
| « November 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 4 | 6 | 7 | ||
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | |||||
| Today | ||||||
Actually the extension should be .html.erb
Posted by Alex MacCaw on December 22, 2007 at 01:04 AM PST #
You are right, now fixed!
Posted by Arun Gupta on December 22, 2007 at 02:40 PM PST #
Merry Christmas to you and your friends,your family.
Posted by michael wang on December 24, 2007 at 07:10 PM PST #
Posted by Arun Gupta's Blog on January 24, 2008 at 04:46 AM PST #