Notes from MonadLUG: David Berube, Ruby on Rails

Eleven members attended the August 14th meeting of the MonadLUG, Monadnock Linux User Group, held as usual on the second Thursday of the month at the SAU1 offices in Peterborough. David Berube was the main presenter.

We had the usual announcements (check upcoming events at http://www.gnhlug.org) and also some time for Q&A while waiting for the main speaker and had the ceremonial struggling with the laptop and the projector. One fellow was looking for help understanding how to install drivers for a scanner not supported by SANE, another had questions on what the keyring was and how he could get it to stop demanding a password from him.

David’s been a fixture in the groups for some years. He served as Fearless Leader of GNHLUG for several years, and took a stint as coordinator of the CentraLUG group. He has written a number of magazine articles and authored or co-authored several books, the most recent, Practical Ruby Plugins, due out later this month.

David gave us a brief history of web development, focusing on the incremental improvements made from scripts to cgi-bin to modules to long-running processes in terms of responsiveness, latency and the ability to scale to larger and quicker demands. He briefly compared Ruby with Perl, Python and Lisp, and then dove into the demo.

David had an Ubuntu laptop that he hadn’t previously done Ruby on Rails development on before, so he showed us the basics of installing Ruby, using Ubuntu’s package manager, and cautioned us against using the OS package manager to install gems: The gem system is a package manager in its own right, and it does things in a somewhat different way than most of the OS package manager tools. Instead, he recommended using ruby to install gems. As is often the case, there were some glitches, so we had a small distraction while we worked through creating the /usr/bin links for rake and rails that somehow hadn’t been created automatically.

David then created a new project, and walked us through the directory structure and the significance of files in each folder. He created a model that defined the wiki example we were creating, a controller to answer requests from the web server, and a view that would render the response from our application. He used the built-in rails and rake scripts to create the example database (SQLite3 is built in and used by default if nothing is specified, new in RoR 2.1), showed how the rails console could be used interactively to create model objects (implicitly saving them to disk) and that the console could be used to add, edit, query and delete objects. He then ran the application, after explaining the logic of URLs constructed in a “RESTful” fashion as http://yourwebserver/controller/action/parameter addresses. David started the built-in Webrick webserver and navigated his browser to http://localhost:3000/page/show/bob to show us Bob’s wiki page entry. Whew!

There was some good Q&A during and following the presentation.

I asked some questions on how a team of developers could insure that they were maintaining the same versions of gems when developing, as the gems are usually installed globally and are not in the main application source code tree. David suggested either creating a local team gem repository, or hardcoding the exact versions you want to freeze the target application at, directly within the code.

Charlie had some questions on how to keep up. While he’d read through the “PickAx” book and the “Skateboard” book, those are already a version out of date. David booted up Pidgin and we chatted with a couple of his fellow authors on what they recommended. Here’s a few links I noted from the meeting:

David also mentioned he was running Gnome-Do, a QuickSilver-clone that lets you launch applications or perform functions with a keyboard shortcut and your keywords. And David also showed off the Vimperator, a Vim-like interface for the FireFox browser. David noted you might find some troubles with Javascript-intensive pages:

Thanks to Charlie Farinella for organizing and running the meeting, to Ken and the SAU for providing the fine facilities, to David for an informative presentation and to all for attending and participating!

, , , ,

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.