chrismoos / fastr

Event-based web framework for Ruby.
http://chrismoos.com
MIT License
83 stars 6 forks source link

No Adapter for default fastr app #1

Closed rurounijones closed 13 years ago

rurounijones commented 13 years ago

I am using: Kubuntu 10.04 Ruby 1.8.7 eventmachine 0.12.10 thin 1.2.7 fastr 0.0.3

Following the guide at http://chrismoos.com/fastr/guide/setup.html

fastr init testapp
cd testapp
thin -p 5000 start

results in

No adapter found for /home/rurounijones/testapp
chrismoos commented 13 years ago

Try passing the -A rack flag to manually specify the adapter.

thin -p 5000 start -A rack

rurounijones commented 13 years ago

Ok I have given that a go but still no luck. I updated rack just to be sure.

gem update rack
Updating installed gems
Updating rack-test
Successfully installed rack-test-0.5.6
Gems updated: rack-test
Installing ri documentation for rack-test-0.5.6...
Installing RDoc documentation for rack-test-0.5.6...

thin -p 5000 start -A rack

Using rack adapter
Adapter not found: rack

If I try to run a small sinatra app then that works

ruby sinatra-test.rb
== Sinatra/1.1.0 has taken the stage on 4567 for development with backup from Thin
Thin web server (v1.2.4 codename Flaming Astroboy)
Maximum connections set to 1024
Listening on 0.0.0.0:4567, CTRL+C to stop

I am not hugely familiar with rack app configuration so I am not sure where the problem lies.

chrismoos commented 13 years ago

I can't seem to reproduce this, its really bizarre. I'm looking through thin's source (lib/rack/adapter/loader.rb)..maybe I can find the cause.

rurounijones commented 13 years ago

Damn, I forgot to mention that I am using 64bit Kubuntu. Could that be an issue? (I wouldn't have thought so but you never know)

chrismoos commented 13 years ago

That shouldn't make a difference, can you throw a "puts 'test'" at the top of your config.ru and then try to run it. You may even want to try surrounding the whole config.ru with a begin -> rescue and then puts the exception (if one is thrown).

rurounijones commented 13 years ago

Stuck the puts command in, nothing new compared to the previous output.

It looks like the config.ru file isn't even being executed

rurounijones commented 13 years ago

Aha using

thin -R config.ru start

and adding

require 'rubygems'

in the config.ru file gets me somewhere. The program starts but then soon bombs out with with

config.ru:5: undefined method `epoll=' for EventMachine:Module (NoMethodError)

Commenting out that line leads to other problems down the line. Other undefined methods. Does fastr require a certain version of EventMachine?

chrismoos commented 13 years ago

It doesn't need a specific version...I'm going to get kubuntu on a VM and see if I can reproduce this..sorry for the problems!

chrismoos commented 13 years ago

Okay, so I installed kubuntu and the problem is the version(s) of Thin and EventMachine that are used if you apt-get install thin.

I was able to get everything running by installing Thin from RubyGems

sudo gem install thin

And then invoking thin with:

/var/lib/gems/1.8/bin/thin -p 8080 start
rurounijones commented 13 years ago

Damn, I didn't even realise I had thin installed via apt-get, must have done that a while ago for another project. Thank you for solving that pebkac!

chrismoos commented 13 years ago

No problem, I'm closing this one out. Let me know if you have any more issues.