Deploying Ruby
I’ve recently moved over to the world of ruby on rails to develop portlets for Ovosuite. Coming from a J2EE background, I can say it’s a breath of fresh air: everything 'feels' light and nimble again... no massive build times, no waiting for containers to deploy, no CMP weirdness.... (Although active record can still give you a turn).
Admittedly my experience with ruby is very minimal, so when it came time to get the services running on our production environment, things became a little painful. Its the usual ruby set-up: apache2 + fast-cgi running on Linux (debian).
A couple of things I've learnt from the experience:
1:DO NOT USE p STATEMENTS!
The application I was deploying has debug 'p' statements (if your unaware, the p statement will print to stdout) littered through the code. This was causing a weird error: "malformed header from script. Bad header= XXX" to appear in my apache logs. It took me a little longer than usual to fix this one because I haven’t used cgi before (my web based skills went from ASP to PHP then onto J2EE). CGI takes the output (stdout) of the application and treats that as the HTTP payload for the web page. During development, rails runs using its internal HTTP server where 'p' statements appear on the console (convenient for debugging), but in a production environment (fast-cgi), those same p statements will be embedded in the server response, which apache cant handle.
The lesson from this is to use the rails logging facilities :) (Although what a really want for Xmas is a full debug environment with stepping and variable inspection etc.. I suppose I’ve been spoilt by java in that regard)
2:Watch what you keep in your session.
Rails has a nifty way of storing sessions (completely serialised to disk (or other)) to allow massive scalability potential. Unfortunately, after a restart, it looses track of what libraries are in use, so it may not be able to de-serialize the session again if you have something a bit exotic in there. This was the case for my the TZInfo: a cool time zone library we use. Apparently it uses a bunch of internal classes in the background to handle each time zone, so even if you have require_gem 'tzinfo' and include TZInfo in your code, it still cannot find your classes when loading the session. The easy way around this is to write a wrapper function that gets the time zone based on the string identifier stored in the session.
3.Basic Linux stuff.
OK, I'm the coder, not the Linux guy in the company, so there are a few other 'obvious' things:
Make sure execute permissions are on dispatch.fcgi
Make sure the shebang in dispatch.fcgi is pointing to /usr/local/bin/ruby
Make sure www-data can write to tmp, log and read everything else
Make sure you change the re-write run in public/.htaccess to use fast cgi instead of cgi:
RewriteRule ^(.*)$ dispatch.cgi [QSA,L] should be RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
That’s about it for now...
References (69)
-
Response: LinkedHe has achieved success who has lived well, laughed often, and loved much -
Response: liz vicious torrentliz vicious torrent -
Response: Cheap phentermine cod.Cheap phentermine. Cheap phentermine free shipping. -
Response: MicrosoftNone -
Response: micro torrent downloadmicro torrent download -
Response: salviasalvia -
Response: energy drinksenergy drink -
Response: MicrosoftOnly best free news! : http://american-citysearch.com -
Response: Viagra -
Response: Make Money Online BlogInsurance And Loans -
FREE Panic at the Disco's New Album TORRENT!!! -
COUNTING CROWS - SAT Nights and SUN Mornings -
Response: COUNTING CROWS - NEWEST ALBUM 2008COUNTING CROWS - NEWEST ALBUM 2008 -
PANIC-AT-THE-DISCO-PRETTY-ODD - NEWEST ALBUM 2008 -
Response: PANIC-AT-THE-DISCO - NEWEST ALBUM 2008PANIC-AT-THE-DISCO - NEWEST ALBUM 2008 -
Response: PANIC-AT-THE-DISCO - NEWEST ALBUM 2008PANIC-AT-THE-DISCO - NEWEST ALBUM 2008 -
Response: Viagra -
Response: Viagra -
Response: Viagra -
Response: Viagra -
Response: Viagra -
Response: Viagra -
Response: CLICK FOR YOUR FREE iPHONECLICK FOR YOUR FREE iPHONE -
Response: Viagra -
Response: e694d68aec49dfef544c3587ec6f4b27e694d68aec49dfef544c3587ec6f4b27 -
Response: CLICKCLICK -
Response: THE TRUTH IS HERETHE TRUTH IS HERE -
Response: Servcorp Virtual Office -
Response: Servcorp Virtual Office -
Response: Viagra -
Response: fearless-releases.com :: LoginFearless-ReleaseS - The best with first releases -
Response: CLICK HERE LADIESCLICK HERE LADIES -
Response: CLICK HERE LADIESCLICK HERE LADIES -
Response: CLICK HERE FOR A FREE PS3 & GTA4CLICK HERE FOR A FREE PS3 & GTA4 -
Response: buy cheap cialisBuy cialis Buy Cialis Online. -
Response: Ashley Tisdale Nude PicsYmca Nude Swimming Story Repost Ashley Tisdale Nude Pics Cute Sayings Quotes For Teens -
Response: Free Gay Cbt VideoLyrics To Smells Like Teen Spirit Calista Flockhart Nude Davo Porn -
Response: Newgrounds MatureBallerina Porn Rbs Insurance Amateurs Free Nude Schoolgirls -
Response: Violent Gay PornExploided Teens Gay Muscle Videos Free Anal Vore -
Response: Dating Mature WomenWoman Having Sex With Dogs Lauren Lee Smith Nude First Gay Time -
Response: Sex TourismAdult Sleeping Beauty Costume Teen Titans Hentai Games Brandie Amateur Nude -
Response: Social Impact Of Blindness In AdultsAdult Matchmaking Sites Gay Scat Man Russian Teen Sex -
Response: Karyn Parsons NudeSex Screensaver Teen Models 3pic Quinne Nude -
Response: Beastyality SexTeen Gothic Gallery Social Impact Of Blindness In Adults Diabetes Adult 2 Natural Treatment -
Response: Play Sex GamesKaryn Parsons Nude Gay Black Male Porn Beastyality Sex -
Response: Dakota Fanning BikiniGyno Porn Haley Bennett Nude Photos Sherilyn Fenn Nude -
Response: Lindsay Lohan Nude FakesFlinstones Porn Bareback Gay Personals Gay Anal Creampie -
Response: Nude In Public VideoGay Sex Techniques Watch Lesbian Porn Clips Ashley Massaro Nude Pics -
Response: Teen Exgirlfriend PicsPrivate Adult Movies Teen Hitch Hickers Nude Male Wrestlers -
Response: Ashley Leggat NudeVanessa Hudgens Nude Photos Uncensored Amber Fry Nude Glamour Model Teen Galleries Nn -
Response: Extreme String BikiniPowerpuff Girls Nude Nude Phun Girls Extreme String Bikini -
Response: Teens Taking ResponsibilitySadomasochism Sex White Female Bodybuilder Porn Nude Venus Williams -
Response: Amanda Bynes Nude FakesAl4 Porn Guntur Sex Teen Party Ideas -
Response: Free Sex Porn VideosTeen Wall Decor Twilight Sex Ebony Free Adult Mpgs -
Response: Boating NudeGay Precum Harley Davidson Bikini Girls Nude Twister Clips -
Response: Shannon Stewart NudeSex Offenders In Ga Milla Jovovich Nude Sex Voyuer -
Response: Lea Walker SexPenelope Cruz Nude Shannon Stewart Nude Gay Fist -
Ellen Muth Nude Nude Sculptures Free Bbw Hut -
Response: Rapidshare Movies - Torrent MoviesHuge download archive blog of Movies, Tv Series, Rapidshare Links Torrents and much more.. -
Response: Nicole Arbour NudeSexy Webcam Girls Woman Caught Sunbathing Nude Tommy Lee Dick Nude -
Response: Sex Big BrotherGay Football Jocks Lea Does Anal Top Celebs Nude -
Response: Homemade Amateur Adult VideosTeen Nude Model Jamaica Webcams Free Gay Yaoi Videos -
Response: Alice Taglioni Nude PhotosLatina In Bikini Amateurs Homepages Maricopa County Jail Webcam -
Response: Free Famous Cartoon PornCarla Bruni Nude Rebecca Romijn Nude Teen Model Forum -
Response: Kari Byron BikiniLisa Nicole Carson Bikini Jessica Biel Bikini Teri Harrison Nude -
Response: How Do Females MasturbateEuropean Slaves European Slaves -
Response: Erotic Masage In Ft LauderdaleBabe Porno Babe Porno -
Response: Free Porn Sites Passoreds FinderIt can often times become burdensome to sort the insightful free porn evidence from the bad. -
Response: sex personals"Though his hit rate was far less than mine," she wrote, "some married women did contact him. But we estimated a quarter of his pursuers were married men!" Ruth says she was flabbergasted by "the level of deception out there in the 'burbs, and in our opinion she gets somewhat hysterical: ...

Reader Comments (5)
rap mp3 free hip hop mp3 download dead hip hop mp3 rap music mp3
I am xrumer, where is my drink?!
It is just a testing ;)