# NameError: ApplicationAPI

**URL:** <https://www.ruby-forum.com/t/nameerror-applicationapi/110479>\
**Category:** Ruby\
**Created:** [July 26, 2007, 6:20pm UTC](https://www.ruby-forum.com/t/nameerror-applicationapi/110479 "2007-07-26T18:20:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@markus](https://www.ruby-forum.com/u/markus)\
**Post date:** [July 26, 2007, 6:20pm UTC](https://www.ruby-forum.com/t/nameerror-applicationapi/110479/1 "2007-07-26T18:20:59Z")

</div>

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](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
