tagged rails

by mars on 2009-07-28 0 Comments

LoadErrors raised from Ruby on Rails' ActiveSupport may look something like:

/usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:426:in `load_missing_constant':
Expected /path/to/the/rails/root/app/models/bacon.rb to define Bacon (LoadError)
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:92:in `const_missing'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:437:in `load_missing_constant'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:437:in `load_missing_constant'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:437:in `load_missing_constant'
        from /usr/local/lib/ruby/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing'
         ... 26 levels...
        from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
        from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
        from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
        from /usr/local/bin/irb:13

The folded/clipped/omitted middle of the stack trace leads to a very frustrating debugging experience.

Read the rest of this entry

by mars on 2007-12-20 5 Comments

On December 9th, after over twelve-years living in Austin, ten of them working as a pro web developer, I accepted a web dev position in San Francisco with Scout Labs. January 7th I start the job: front-end Ruby on Rails web development.

The company's product, the Scout, already received a revealing write-up by TechCrunch. The possibilities of the Scout are just beginning, and I'm ecstatic to become part of the team building this phenomenally useful tool.

Read the rest of this entry

by mars on 2007-07-05 5 Comments

Well this is quickly becoming Mars' notes from building software on OS X blog!

Anyway, after following the official RMagick install, gem install rmagick fails with an error like:

/usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.7/./lib/rvg/misc.rb:321:
in `get_type_metrics': unable to read font `/Library/Fonts/Verdana' (Magick::ImageMagickError)

It seems that the examples fail because of a spurious font choice in the documented examples.

All that is needed to build the RMagick gem successfully at this point is:

sudo gem install rmagick -- --disable-htmldoc

And voila, the examples aren't built, thereby avoiding the problem.

RMagick!

by mars on 2007-06-05 0 Comments

Say for instance you just applied a software update to your Mac OS X Server and rebooted.

Suddenly a Rails app that was running fine spits out an error when ActionPack does a redirect_to. In the Rails production.log:

SystemStackError (stack level too deep)

Well my friend, before you set off to debugging the Ruby install on your OS X machine, try clearing the Rails sessions. At the command line:

rake tmp:sessions:clear RAILS_ENV=production

Everyone must login again, but alas the problem is solved! [for me]

Is it because we're using Apple's built-in Apache 1.3 web server with source-compiled FastCGI support? Hmmm.

by mars on 2007-05-10 0 Comments

Building a new application, using RESTful architecture, suddenly some things become difficult. Why?

When faced with only CRUD methods on controllers, not only objects must be modeled. The process of creating objects must modeled to fit into CRUD. No longer can a happy programmer delegate the process of creating & relating objects to the controller layer of the application.

For example:

We need a process for someone to sign-up for an account.

In the old school: create a controller action for each step of the sign-up; put the logic in the controller.

In the new school: create a SignUp object with methods to model the process; call the steps as Read (of CRUD) alternate variations from the controller.

by mars on 2006-09-20 1 Comment

Here are the rough notes and PDF of my presentation to the Austin on Rails group last night.

Keynote PDF: Web Apps that Mesh

Read the rest of this entry

by mars on 2005-12-04 3 Comments

In the spirit of Ruby's & Rails' blossoming community of open-source developers, these meetings are free to attend & open to all.

There are different levels & types of people involved, but of course the more prevalent & outspoken tend to be the more confident & experienced developers (though this is less true for the Rails group).

There are two different groups...

Read the rest of this entry

by admin on 2005-06-18 0 Comments

After months of weekend-afternoon cafe work & late-night development sessions, I'm pleased to present a new web site created for sword/knife designer, bladesmith & goldsmith Jot Singh Khalsa of Millis, Massachusetts:

Visit this new site which features almost 150 fine handcrafted knives & swords created by Jot Singh over the past three decades.

I constructed the site in Ruby on Rails, that new-skool web development framework that lets web developers gracefully build high-quality, sustainable applications.

The site is hosted at TextDrive using lighttpd/FastCGI/Ruby/MySQL.

by admin on 2004-12-31 0 Comments

Rails Logo Remix

Between learning probably the most advanced web application framework and an upcoming project to develop a custom email server filter module, both in Ruby, a 10-year-old object-based scripting language born in Japan, I am one busy coding monkey.

At this point, I am convinced that Ruby is not a programming language in the traditional sense. Ruby is expressive codespeak. The most challenging aspect of learning it, is unlearning the convoluted tricks that the utilitarian languages of my last 10-years tattooed into my brain.

This shift of thinking is akin to a shift I experienced around 1990 from line-number-based BASIC programming [on my family's TI-994a!], to modular HyperTalk/Pascal/VBScript/PHP.

Mars now waxes nostalgic to the late nights he spent in high school whipping up HyperCard stacks on his sister's Macintosh Classic II. Mars dearly thanks Natalie for having that little toaster at home where he could use it!



Everything is here.