Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get "Thin adapter not found"?

I'm an iOS developer with very little Ruby experience, trying to follow "Getting Started with iOS Mobile Development and a Sinatra API" on getting an API running on Heroku.

I grabbed the sample project on Git, so I know I have an identical setup to what I'm supposed to have.

I've bundle installed, and thought that everything should be ready to go, but whenever I do a foreman start I get this:

2:14:56 web.1     | started with pid 5140
12:14:57 web.1     | No adapter found for {MY PROJECT'S FILEPATH}
12:14:57 web.1     | process terminated
12:14:57 system    | sending SIGTERM to all processes

What am I doing wrong, or what do I need to do to get this to run?

Thanks!

like image 948
Ethan Avatar asked Feb 11 '12 17:02

Ethan


1 Answers

You are missing a config.ru file that is required to know how to start the application.

Create a file in your root called config.ru and add the following to it:

require './api'
run Sinatra::Application

You can test this is correct by running rackup in the project root. If the config file is correct then your server should start.

Please read When to use config.ru and http://devcenter.heroku.com/articles/rack for further information.

like image 108
Gazler Avatar answered Sep 19 '22 04:09

Gazler