developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Imprinted Promotions
KVM over IP
Data Center Solutions
GPS Devices
Home Improvement
Calling Cards
Computer Hardware
KVM Switch over IP
Laptops
Condos For Sale
Online Shopping
Disney World Tickets
Shop Online
Hurricane Shutters

 


Web Devs:
Moonlight as a Game Developer and Win Cool Prizes by Accepting the RIA Run Challenge

Now, your mission--should you choose to accept: Take your shot at gaming stardom if you think you might have what it takes to build a cool RIA game and you could win an Xbox 360 or other fabulous prizes. Hurry! You only have until May 15, 2008 to enter. »

 
Article:
Leveraging Your Flash Development with Silverlight

You're not giving up Flash any time soon (and we don't blame you.) But if you could get your Flash application working in Silverlight, why wouldn't you? We show you the tools and techniques required to have your rockin' Flash application rolled for Silverlight. Learn more here. »

 
Article:
What Does it Take to Build the Best RIA?

With the proliferation of Rich Interactive Application (RIA) platform choices out there, you no longer have to take a one-size-fits-all approach to developing your next RIA application. Knowing the strengths (and weaknesses) of each platform can help you to decide the best RIA for your next application. »

 
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

JRuby on Rails with Nine Lives: Running a JRuby on Rails Application on Tomcat
By Dominic Da Silva

Go to page: 1  2  3  4  5  6  7  8  Next  

If you have not heard the buzz about JRuby and Rails, you must be living under a rock. The Java, Ruby and Rails communities are all excited with possibilies that JRuby and Rails gives to web application developers. Java has been used for more than 10 years in desktop, mobile, web, and enterprise application development. Ruby and Rails are the twin towers of web application agility and coolness and are igniting the web and software application development community with their pragmatic practices. With JRuby, Ruby, and Rails, applications can now run on top of JVM and use the vast Java frameworks and libraries available.

In my previous article, "Running your First Rails Application on JRuby," I showed you how to get JRuby installed and create and run a basic non-CRUD Rails application within it. This was simple and painless and demonstrated JRuby's initial support Rails. Since then, JRuby has been enhanced to fully support Rails and is now at version 1.0 status. In this article, you use JRuby to create a simple CRUD-based Rails application for managing a list of guitars (similar to the one in my "Skip the CRUD" article) and run it on the Java-based Tomcat application server. This will demonstrate JRuby's improved support for Rails applications by using database access via JDBC and the ability to run a Rails application on a Java application server.

Installing JRuby

For this article, I will use a machine running the Ubuntu Linux distribution. I am going to assume you already installed JRuby 1.0 into the /opt/jruby-1.0 directory. I create a symbolic link in /opt/jruby pointing to the JRuby install directory. You will also need to create a $JRUBY_HOME environment variable pointing to the /opt/jruby directory so you can run JRuby commands anywhere. The following screenshot shows JRuby 1.0 installed in /opt:



Click here for a larger image.

Figure 1: JRuby installation

Installing Rails in JRuby and Creating Your Rails Application

Installing Rails into JRuby is as simple as running the following command from your $JRUBY_HOME directory:

jruby -S gem install rails -y -–no-ri -–no-rdoc



Click here for a larger image.

Figure 2: Installing Rails into JRuby

The –S switch tells JRuby to run the command in JRuby's bin directory.

You'll need to install the ActiveRecord-JDBC gem as well. This will allow Rails' ActiveRecord to use Java's native JDBC driver to access the database:

jruby -S gem install activerecord-jdbc



Click here for a larger image.

Figure 3: Installing ActiveRecord-JDBC into JRuby

Now, create your JRuby on Rails application. I change directories to my local JRuby apps directory /home/dsuspense/jruby/apps and create a railswartest application:

jruby –S rails railswartest

Go to page: 1  2  3  4  5  6  7  8  Next  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Database Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Guide to Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.
Five Trends for Application Development. Download Your Complimentary Report. Exclusive. Act Now.
Whitepaper: Embeddable Content Platform for OEM's
Developing Intelligent Communications? Visit the Avaya DevConnect Center on DevX.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES