I have a rails application that has a Application controller that
exposes REST API. And for the data I am using a third party module
instead of rails Model.
Route.rb:
match "/plugins" => "plugins#get_plugins", :via => "get"
My controller has following method:
def get_plugins
render :text=> third_party_module.get_plugins()
end
third_party_module.get_plugins() is the third party module that returns
data.
Functional test file: plugins_controller_test.rb has the following test
method:
test "should get plugins" do
get :get_plugins
assert_response :success
end
When I am trying to run functional test, it gives following error:
"db/schema.rb doesn't exist yet. Run "rake db:migrate" to create it then
try again"
/home/peterv/data/backed_up/rails-apps/apps/temp/with_AR/db/schema.rb doesn’t exist yet. Run “rake db:migrate” to create it then try again. If you do not intend to use a database, you should instead alter /home/peterv/data/backed_up/rails-apps/apps/temp/with_AR/config/application.rb to limit the frameworks that will be loaded
So, to me this is quite clear about the issue …
As easy solution, I then installed without ActiveRecord (read rails help to find out):
peterv@ASUS:~/b/rails-apps/apps/temp$ rails new without_AR --skip-bundle --skip-active-record
…
add gem ‘therubyracer’ to Gemfile and run bundle install