Dec 11
Part 1 – Flex Cairngorm/WebORB Issue Tracker Tutorial
This is the first in a series of posts/tutorails that will cover certain features of the Issue Tracker sample app that I recently released.
Future posts will cover:
- How to return typed objects from Ruby on Rails using WebORB.
- How to use active record associations.
- How to use dynamic finders inside of Flex.
- Anything else that you tell me you would like me to cover….
This post will cover how to set up and run the application in Flex.
Â
Prerequisites
- Ruby 1.8.4+
- Rails 1.1.6+
- MySQL 4.1+ (or any other database that works with Rails migrations)
- Flex Builder 2
Recommended
First, if you haven’t already, download the source for the application: http://flexonrails.net/flex_ror_sdk_issue_tracker2.zip.Â
Unzip it, then put the rails_issue_tracker2 folder into C:\rails
Next, start up Flex Builder. Click on the File menu and select New->Flex Project
In the interface that appears, select Flex Data Services and Compile Application locally in Flex Builder.Â
Then click Next>
Â

Â
Fill in the next screen as follows:
- Root folder: C:\rails\rails_issue_tracker2\config
- Root URL: http://localhost:3000/weborb
Then click Next>
Â

Â
On the following screen, enter flex_issue_tracker2 for the Project name.
Click Next>
Â

Â
You need to add the Cairngorm.swc to your libraries for this project. The Cairngorm.swc was is included in the source files for this project. You can find it here: flex_ror_sdk_issue_tracker2\Flex_Source\flex_issue_tracker2\cairngorm.Â
Take the .swc file and put it in a folder of your choice.
Then click Add SWC and browse to folder that you put the swc in.
Â
Â
Â
On the same screen, fill in the form as follows:
- Main application file: Main.mxml
- Output folder:c:\rails\rails_issue_tracker2\public\examples
- Output folder URL: http://localhost:3000/examples
Click Finish
Â

Â
Next, open the following folder in the source files: flex_ror_sdk_issue_tracker2\Flex_Source\flex_issue_tracker2
Select the folders and files shown below and add them to the flex_issue_tracker2 project that you just created.
That takes care of the Flex side of things. Now all you need to do is set up the database and tell the Rails app how to access it.
Â
Â
Â
If you are using MySQL, open up the MySQL Command Line Client and enter:
CREATE DATABASE issue_tracker;
Â

Â
Next, go to the config folder in your Rails app (rails_issue_tracker2\config) and open database.yml.
Fill in your username and password for your database where indicated below.
Â
Â
Â
Now that your Rails app can access your database, it’s time to create the tables using Rails migrations. You can see the files that define the tables by going to rails_issue_tracker2\db\migrate.
Open a command line and point it to your Rails app folder (c:rails\rails_issue_tracker2) and enter
rake migrate
Ok, the tables have been created and the app is ready to go. All that remains to do is to boot up the server and test it out. On command line enter
ruby script/server (or mongrel_rails start if you are using Mongrel).
Â

Â
Lastly, go back into Flex Builder, click Run Debug(F11), and you should see the screen displayed below.
Â

Â
Let me know if you have any questions, or if anything in this post is unclear or incorrect.

December 11th, 2006 at 9:12 am
[...] FlexOnRails.net is starting a couple of tuturials about their Issue Tracker Flex Application. The first part is about setting up the application and running it in Flex. [...]
December 11th, 2006 at 7:50 pm
I’ve got the problem, that everytime I change something in the WebORB service, I have to restart the server, otherwise the service isn’t updated to my new code.
Do you got a solution to this problem?
December 11th, 2006 at 9:18 pm
I have the same problem.
You can try adding
include Reloadable
to your service classes. This has not worked for me (it causes an error), but you might want to give it a try.
December 12th, 2006 at 10:02 am
include Reloadable also didn’t worked for me. I hope there will be a solution soon, because it gets very anoying.
December 12th, 2006 at 3:23 pm
Niels and Derek,
The \”Reloadable\” problem is now fixed. You can read more about it at: http://blog.themidnightcoders.com/2006/12/reloadable-reloaded-auto-reload-weborb.html
Get the latest build (1.1.1) to see the change.
Thanks,
Mark
December 13th, 2006 at 2:55 pm
Hi Mark,
Thanks for the update. That is very good news.
December 17th, 2006 at 1:41 am
[...] The first post explained how to set up the application. [...]
December 20th, 2006 at 4:03 pm
[...] FlexOnRails have two (first, second) detailed posts on using WebORB for Rails with Flex. The demo app uses Adobe’s Cairngorm a framework for Flex and it’s Value Objects which can be mapped to server side objects. Make sure to read the comments on the second post as Derek Wischusen explains the value of Value Objects. [...]
December 22nd, 2006 at 4:06 pm
Wow! I should get more into WebOrb! Thanx for making/sharing the tutorials.
January 9th, 2007 at 2:13 am
[...] The first post explained how to set up the application. [...]
January 9th, 2007 at 4:15 pm
[...] Part 1 [...]
January 13th, 2007 at 11:53 pm
[...] The first post explained how to set up the application. [...]
January 26th, 2007 at 5:35 pm
when i start the server, i get this error:
2007-01-26 12:33:10: (mod_fastcgi.c.1022) execve failed for: /Users/veracarr/Desktop/rails_issue_tracker/public/dispatch.fcgi No such file or directory
2007-01-26 12:33:10: (mod_fastcgi.c.1048) the fastcgi-backend /Users/veracarr/Desktop/rails_issue_tracker/public/dispatch.fcgi failed to start:
2007-01-26 12:33:10: (mod_fastcgi.c.1052) child exited with status 2 /Users/veracarr/Desktop/rails_issue_tracker/public/dispatch.fcgi
2007-01-26 12:33:10: (mod_fastcgi.c.1055) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing ‘php -v’ and it should display ‘(cgi-fcgi)’ in the output, NOT (cgi) NOR (cli)
For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program
2007-01-26 12:33:10: (mod_fastcgi.c.1060) If this is PHP on Gentoo add fastcgi to the USE flags
2007-01-26 12:33:10: (mod_fastcgi.c.1356) [ERROR]: spawning fcgi failed.
2007-01-26 12:33:10: (server.c.834) Configuration of plugins failed. Going down.
i haven’t had this issue with any other rails apps. any suggestions? thanks in advance
January 30th, 2007 at 4:01 am
[...] å°±å¯ä»¥æ¸¬è©¦çœ‹çœ‹äº†! åƒè€ƒ: http://flexonrails.net/?p=34 [...]
January 31st, 2007 at 9:58 am
[...] Part 1 – Flex Cairngorm/WebORB Issue Tracker Tutorial [...]
February 10th, 2007 at 8:47 pm
I get a routing error when I launch the application — “no route found to match “/examples/Main.html” with {:method=>:get}”
February 10th, 2007 at 9:39 pm
Hi Mike,
Looks like the html file included in the source for the non-debug version is named main.html (lower-case m).
If you go in to public/examples and rename the file to Main.html, that should solve the problem. Alternatively, you could launch the app in debug mode, which should also work.
Derek
February 10th, 2007 at 9:45 pm
I apologize – I had more than one webrick server running! Thanks for the outstanding tutorial.
April 8th, 2007 at 6:56 am
Awesome. I got this working with the Rails eclipse plugin so that everything is stationed inside of Flex Builder.
Who has the Rails hosting that will be kind to weborb? I have noticed, locally, unless I have the :3000 it dies. I remapped apache to my public dir, but it still fails with weborb unless I have the :3000. Plus all the reboots. Everytime I upload to my host, I get “send failed”. This is with the weborb tests.
April 8th, 2007 at 6:57 pm
Hi Joel,
The trick to getting WebORB running on your host is that you have to be able to restart the server once you’ve installed the WebORB plugin.
I use A2hosting, who I highly recommend. To date, their support has been very good and I have not had any downtime (that I am aware of).
To get WebORB working I had to set up a separate Mongrel server (the one at apps.flexonrails.net) that I could start/stop/reboot.
So, A2 has been working well for me, but any host where you can set up separate Mongrel server should work.
Derek
April 8th, 2007 at 9:44 pm
Unfortunately dreamhost, my preferred solution, won’t let users currently control individual mongrel servers. I tried railsplayground, but I was a little put off when I asked him about weborb and he replied that “Your page properly displays ‘Flash Plugin Needed’ – so what’s the problem?” I don’t have the vocabulary just yet to describe what I need.
I don’t have a need for remote hosting just yet, but when the time comes I might pick your brain for specifics if that would be OK. Right now it runs like a treat locally, so I can get my learn on.
April 30th, 2007 at 6:05 am
hi,
this is a great example for beginners. well i’ve a question i’m not able to track the service for users.the other two service for issueservuce and projectservice are available.can you tell me where the user service is present? and how’re u invoking the two functions in the user service?
Thanks,
Shajahan
May 1st, 2007 at 2:54 am
Hi Shajahan,
The UserService in Flex is mapped directly to the User model class in Rails. So, the those methods are being invoked directly on the User class.
Check out this post for more details: http://flexonrails.net/?p=54
Derek
May 8th, 2007 at 9:31 pm
[...] are some very useful tutorials on how to implement the [...]
June 15th, 2007 at 5:37 pm
Has anybody tried following this tutorial while using FlexBuilder 3? The new dialog window for setting up a Flex application is throwing me off: the options for server type are:
Other/none
PHP
LiveCycle Data Services
ColdFusion
ASP.NET
Not sure what one selects when using WebORB for RoR.
Thanks,
Daniel
June 25th, 2007 at 2:48 pm
In FlexBuilder 3 I’ve chosen LiveCycle Data Services (as I see they’re new Flex Data Services) but when I try to run this project I get:
VerifyError: Error #1053: Illegal override of subtopic in mx.messaging.Consumer.
at frame2
at [abc-decode]
at flash.display::MovieClip/nextFrame()
at mx.managers::SystemManager/private::deferredNextFrame()
at mx.managers::SystemManager/private::preloader_initProgressHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/private::timerHandler()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
does anywone have a clue what i do wrong?
September 27th, 2007 at 5:48 pm
Regarding the error you got:
VerifyError: Error #1053: Illegal override of subtopic in mx.messaging.Consumer.
at frame2
…
I hit this problem and it was due to having put some LCDS specific libaries in the $FRAMEWORK and $LOCALES directories that you include in your project. I had been working with LCDS and instructions somewhere (I think a tutorial) told me to do this. Since I didn’t remember which files I added I reinstalled both Eclipse and the flex plugin which brought me back to the base files for running a flex project without LCDS. I no longer got this error. Hope that helps.
November 29th, 2007 at 5:41 am
here is not any explanation of code used in .as files
May 8th, 2008 at 9:41 am
I only got far as the builder requirement – not available for linux
September 29th, 2008 at 9:51 am
[...] Wischusen :: Flex Cairngorm/WebORB Issue Tracker Tutorial :: Part 1 :: Part 2 :: Part 3 :: Part 4 Published [...]
September 30th, 2008 at 12:21 pm
[...] Wischusen :: Flex Cairngorm/WebORB Issue Tracker Tutorial :: Part 1 :: Part 2 :: Part 3 :: Part [...]
September 30th, 2008 at 12:48 pm
[...] Wischusen :: Flex Cairngorm/WebORB Issue Tracker Tutorial :: Part 1 :: Part 2 :: Part 3 :: Part [...]
October 14th, 2008 at 5:26 am
[...] Wischusen :: Flex Cairngorm/WebORB Issue Tracker Tutorial :: Part 1 :: Part 2 :: Part 3 :: Part [...]