undefined method `render_component’ with ActiveScaffold and Rails 2.3.2

Problem
When using a nested (or embedded) scaffold in ActiveScaffold with Rails 2.3.2 you have the error:

undefined method `render_component'

Solution
According to the issue here, in Rails 2.3 the render_component has been removed.

Install the render_component from:

script/plugin install git://github.com/lackac/render_component.git -r rails-edge

and restart your server, and it should be working.

Spree installation error in Mandriva.

Problem
You are trying to install spree from the git source, following the instructions from here, but there are errors like:

gem install activemerchant --version "= 1.4.1"      
ERROR:  While generating documentation for builder-2.1.2
... MESSAGE:   Unhandled special: Special: type=17, text=""
... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/builder-2.1.2/ri --title Builder 
    -- Easy XML Building --main README --line-numbers 
    --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc 
    doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.

Solution
Make sure you have the following gems installed:

sudo gem install builder haml echoe

and then run:

sudo rake gems:install

Upgrading to 2.3.2 – Uninitialized constant ApplicationController

Problem
Upgrading from a previous version of Rails to the latest 2.3.2, you get an error:

NameError: uninitialized constant ApplicationController

both in the web browser and in console.

Solution
Since the introduction of Rails 2.3 the application.rb file has been renamed to application_controller.rb.
So in order to solve the problem just rename your file application.rb to application_controller.rb.

Thanks to the post here

Using ActiveScaffold in Rails 2.2 after using default scaffolding

Problem
You want to use ActiveScaffold in Rails 2.2, in a model that you have created using the standard Rails scaffolding script.

Solution

  1. Install the ActiveScaffold plugin:
    script/plugin install git://github.com/activescaffold/active_scaffold.git -r rails-2.2
  2. In your layout (model or application for all models) add the following:
    <%= javascript_include_tag :defaults %>
    <%= active_scaffold_includes %>
  3. In your controller file delete all the standard scaffolding code and add one line, so that your new controller should look like:
    class SomethingsController < ApplicationController
      active_scaffold :something
    end
  4. To configure a RESTful scaffold add the following to your route.rb file:
    map.resources :somethings, :active_scaffold => true
  5. Delete the views that were created from the standard rails scaffolding in the views/somethings folder (edit, show, index ...)
  6. Restart your server

You should now have an active scaffold for your model.

undefined method `find_by_contents’ ,acts_as_ferret

Problem
When trying to use the acts_as_ferret plugin in a search page by using the find_by_contents method then the following error appears:

undefined method `find_by_contents'

Solution
It seems that the API of the plugin has changed, and the

find_by_contents

method should be replaced with the:

find_with_ferret

method

ERROR: While executing gem … (ArgumentError)

Problem
After a recent upgrade to a newer rails version the gem package manager seems to be broken. Everytime you try to use gem install gem_name, you get the following error:

ERROR:  While executing gem ... (Gem::GemNotFoundException)

Deleting the cached files as suggested in other posts results in the error:

ERROR:  While executing gem ... (ArgumentError)

Solution
As suggested here, you need to do:

gem install rubygems-update
update_rubygems

which should be updating the gem version to the latest one, ie 1.3.0

FBML Error (line 5): illegal tag “body” under “fb:canvas”

Problem
When trying to use facebooker according to the Developing facebook platform applications with rails book, in the network_test step you are getting the following error:

FBML Error (line 5): illegal tag "body" under "fb:canvas"

Solution
It should be caused because you are using the facebooker gem instead of the plugin.
Install the plugin:

ruby script/plugin install git://github.com/mmangino/facebooker.git

Running script/runner in production environment

Problem
Following from a previous post about email scheduling with runner and cron, it turns out that the runner default behaviour is to run in the development environment.

Solution
Although by reading the help for the script/runner, there is a suggestion to run it with the -e production added to the end, it doesn’t seem to be working.

The solution to make it running in the production environment was to delete the first line (shebang) from step 3 on this post

#!/usr/bin/env /path_to_your_app/script/runner

and then use the following in the cron setup:

RAILS_ENV=production /path/to/your_ror_project/script/runner /path/to/your_ror_project/lib/email_scheduler.rb

Have a look on paragraph Alternative Usage here