Installing Ruby and Rails on Mac OS X

Ruby and SQLite come with Mac OS X. Ruby is a bit older, and had some trouble installing Rails, so we ugraded: srv-8:~ usr4$ sudo port upgrade sqlite3 Password: —> Fetching ncursesw —> Attempting to fetch ncurses-5.7.tar.gz from http://mirrors.kernel.org/gnu/ncurses —> Verifying checksum(s) for ncursesw —> Extracting ncursesw —> Configuring ncursesw —> Building ncursesw —> Staging […]

Porting an Existing Static Database-derived Web Site to Ruby on Rails

[Note that this article is an experiment in hacking a Rails app in to static HTML off of a single root directory. This was done with routes.rb and some parsing of the URL within Rails. This is interesting in its own right, so we are leaving it up; however, a much better way is to […]

Moving from WEBrick to Mongrel

I’ve been moving more and more pages over to NetAdminTools, and the render time is starting to take a long time. => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-07-20 06:29:17] INFO WEBrick 1.3.1 [2010-07-20 06:29:17] INFO ruby 1.8.7 (2009-12-24) [i686-linux] [2010-07-20 […]

Ruby Loops and ANSI Color

Here is a quick little script to illustrate loops and the Term-Ansicolor gem: require “rubygems” require “term/ansicolor” c = Term::ANSIColor print c.white,c.bold,c.on_blue print ” ” puts for w in [ “words”,”in”,”an”,”array” ] print ” “+w end print ” ” print c.reset print “\n” I originally made this because wanted to create a graphic with monospaced […]

Passenger Memory Stats

Use passenger-memory-stats while your app is loaded to see how your system handles your session settings. We use the –max-pool-size 50 option to limit the number of passenger sessions that connect to our RoR application. Here are the stats under load: root:/usr/local/bin# passenger-memory-stats ————- Apache processes ————- *** WARNING: The Apache executable cannot be found. […]

403 Forbidden Error With Passenger

I spent way, way too much time troubleshooting a 403 error with Passenger: =============== Phusion Passenger Standalone web server started PID file: /opt/mcjr/passenger.9000.pid Log file: /opt/mcjr/log/development.log Environment: development Accessible via: http://0.0.0.0:9000/ Serving in the background as a daemon. 403 Forbidden nginx/0.8.52 It turns out that even though thee permissions on my rails app were fine, […]

Converting a Rails App to present with GTK

This article shows how to convert a Rails application to a standard Ruby application, and it shows how to present the data via GTK2. The idea is that a web application and a desktop application can have similar needs, and going back and forth via a common framework has some advantages. We are taking this […]

Ruby Regex Substitution – Benefit of Controllers

This site is generated on RoR, but published as static HTML. It goes way, way back, and the images are referenced in many ways. I think there is a decent chance that some images are referenced without quotes. I added a feature for mobile views years ago, so that I could easily browse with my […]