[Rails] NameError: ApplicationAPI

M

Markus

Just for the record...

I've seen occasional mentions of a problem people have had upgrading
existing Rails 1.1.x applications to Rails 1.2.x, leading to complete
failure of the application with the message:

NameError: Neither ApplicationApi or ApplicationAPI found

...but I've never seen a general solution posted, or even an explanation
of what caused it. (Google finds this:

http://weblog.oriontransfer.co.nz/articles/2007/04/12/rails-1-2-2-problem-with-older-engines

but it appears not to have helped most people).

Yesterday I ran into the problem myself and thought I should post the
probable cause and likely fix for posterity.

The problem: The older application has web services enabled but is not
actually using / defining and web services (i.e., does not define the
class ApplicationAPI). This was not a problem in earlier versions of
Rails as the didn't try to access the API if it wasn't defined; later
versions apparently assume that if you are using web services you have
an API defined.

What is likely to fix it: find the line(s) in config/environments.rb
that disable unused frameworks and make sure that you are disabling
web_services:

config.frameworks -= [:action_web_service, ... ]

You may also need to check config/environments/*.rb as the settings
there would override those in environments.rb.

--MarkusQ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,314
Members
47,993
Latest member
Meri511146

Latest Threads

Top