[Ruby on Rails] uninitialized constant ActiveSupport::~::ForRspec
Today I got an error below with rake. What happened? % rake -T (in /home/ice/messa/hulor) rake aborted! uninitialized constant ActiveSupport::Testing::SetupAndTeardown::ForRspec /home/ice/messa/hulor/Rakefile:12 (See full trace by running task with --trace) Related gem packages version: rails 2.3.2 rspec 1.2.4 rspec-rails 1.2.4 I can’t remember what I did. But maybe I installed rails into my project (not on system). I did below???? I can’t remember. % rake rails:freeze:edge #801 ‘No such file to load’ when running ‘rake spec’ Sounds like you’ve got rails edge, not rails-2.3.2. These files moved post-2.3.2 – same with ForRspec – that’s all in rails edge, which is now moving towards rails-3.0, and...
[Ruby] ActiveRecord off Rails
How to use ActiveRecord without Rails. Memo Usually no need to write definition of database tables. Just define sub class of ActiveRecord::Base. ActiveRecord automatically checks table definition at the first access. Better to use ActiveRecord’s naming rules If name tables or fields without the naming rules, should add extra code into sub class of ActiveRecord::Base Need to write SQL directory when do complicated stuff. Access to table with sub class instance of ActiveRecord::Base Basic Usage Create database configuration YAML file Create a sub class of ActiveRecord::Base for each table Establish connection with the YAML file. Do something with the sub class of ActiveRecord::Base Simple Usage #!/usr/bin/env ruby # definition of 'groups' table #CREATE...
Learning Ruby – Part 1
I’ve set out to learn Ruby and eventually Ruby on Rails so that I can better integrate with the programming team. I’ve programmed in perl and php before though I have never reached a level where I felt I had mastered them. There is a belief that you need to practice an art (and programming is both a science and an art) consistently for ten years before you can truly master it. As someone who spent almost 8 hours a day in Illustrator 8/OS9 for a year, and only partly mastered the sub-set needed to create perfect signs, I do believe it is close to the truth. So I may not ever truly master Ruby either. However, like Perl, Ruby intrigues me. From what I’ve learnt about it, it is both an elegant language and a practical language. ...

