I've generated a model in my app called Twitter::Tweet, it's defined in app/models/twitter/tweet.rb as follows:
class Twitter::Tweet < ActiveRecord::Base
end
The generator also created a file in app/models/twitter.rb as follows:
module Twitter
def self.table_name_prefix
'twitter_'
end
end
Unfortunately, whenever I try to call Twitter::Tweet.find I get a undefined method "find" for Twitter::Tweet:Class error. This also happens when I try ::Twitter::Tweet.find. This is my first time working with Namespaced models, and for the life of me I can't figure out how to get them to work properly. Any ideas before I give up on them and just move on?
Here's the tweet_controller.rb
class Twitter::TweetsController < Twitter::BaseController
def show
#tweet = Twitter::Tweet.find(params[:id])
end
end
Stack Trace
app/controllers/twitter/tweets_controller.rb:3:in `setup'
actionpack (4.1.7) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.7) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.7) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.7) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:678:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.2) lib/omniauth/builder.rb:59:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.7) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.7) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.7) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.7) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.7) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/static.rb:84:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.7) lib/rails/engine.rb:514:in `call'
railties (4.1.7) lib/rails/application.rb:144:in `call'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:155:in `handle'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:109:in `rescue in block (2 levels) in start'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:106:in `block (2 levels) in start'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in `each'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:96:in `block in start'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in `loop'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:76:in `start'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in `run'
/Users/ryan/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/bin/nack_worker:4:in `<main>'
you controller should be under app/controllers/twitter/tweets_controller.rb and should look like
class Twitter::TweetsController < ApplicationController # maybe you have some problem in Twitter::BaseController
def show
#tweet = ::Twitter::Tweet.find(params[:id])
end
end
#routes.rb:
namespace :twitter do
resources :tweets
end
#app/views/twitter/tweets/show.html.erb:
<%= #tweet.title %> # or whatever
and you get that page with: http://lvh.me:3000/twitter/tweets/1
and that should work. (your models are ok)
Related
I just started using Rails and I'm stuck. I cannot understand why I'm getting this error:
This is the class InnkeeperBillingInformation:
class InnkeeperBillingInformation < ApplicationRecord
belongs_to :user
validates :first_name, :last_name, :company_name,
:address, :municipality, :province, :country,
:zip_code, :tax_code, :vat, :email, :phone_number,
presence: true
after_create :generate_invoice
private
def generate_invoice
subscription = user.innkeeper_subscription
subscription.invoices.create(number: generate_invoice_name(user), amount: subscription.type.price)
end
def generate_invoice_name(user)
month = Time.now.strftime("%B")
"Abbonamento: #{user.subscription_type} - #{month} #{Time.now.year}"
end
end
This is the controller:
def create
#innkeeper_billing_information = InnkeeperBillingInformation.new innkeeper_billing_information_params
if #innkeeper_billing_information.save
redirect_to dashboard_path, notice: "Dati di fatturazione salvati con successo!"
else
redirect_to({ action: :index }, notice: "Non รจ stato possibile completare la richiesta.")
end
end
Class NullInnkeeperSubscription:
class NullInnkeeperSubscription
def id
nil
end
def active?
false
end
def empty_array
[]
end
def type_name
"Nessuno"
end
%w(eateries menu_sections menus dishes invitations innkeeper_subscription_managers).each do |method|
alias_method method, "empty_array"
end
end
Class User.rb:
def innkeeper_subscription
innkeeper_subscriptions.detect(&:active?) || NullInnkeeperSubscription.new
end
This is the Stack trace:
NoMethodError - undefined method `invoices' for #<NullInnkeeperSubscription:0x00007fc42ebf3930>:
app/models/innkeeper_billing_information.rb:15:in `generate_invoice'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:382:in `block in make_lambda'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:207:in `block in halting_and_conditional'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:456:in `block in call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:456:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_create_callbacks'
activerecord (5.0.7.2) lib/active_record/callbacks.rb:302:in `_create_record'
activerecord (5.0.7.2) lib/active_record/timestamp.rb:68:in `_create_record'
activerecord (5.0.7.2) lib/active_record/persistence.rb:548:in `create_or_update'
activerecord (5.0.7.2) lib/active_record/callbacks.rb:298:in `block in create_or_update'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_save_callbacks'
activerecord (5.0.7.2) lib/active_record/callbacks.rb:298:in `create_or_update'
activerecord (5.0.7.2) lib/active_record/persistence.rb:129:in `save'
activerecord (5.0.7.2) lib/active_record/validations.rb:44:in `save'
activerecord (5.0.7.2) lib/active_record/attribute_methods/dirty.rb:22:in `save'
activerecord (5.0.7.2) lib/active_record/transactions.rb:319:in `block (2 levels) in save'
activerecord (5.0.7.2) lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `block in transaction'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
activerecord (5.0.7.2) lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
activerecord (5.0.7.2) lib/active_record/transactions.rb:211:in `transaction'
activerecord (5.0.7.2) lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
activerecord (5.0.7.2) lib/active_record/transactions.rb:319:in `block in save'
activerecord (5.0.7.2) lib/active_record/transactions.rb:334:in `rollback_active_record_state!'
activerecord (5.0.7.2) lib/active_record/transactions.rb:318:in `save'
activerecord (5.0.7.2) lib/active_record/suppressor.rb:41:in `save'
bullet (5.5.0) lib/bullet/active_record5.rb:5:in `save'
app/controllers/dashboard/innkeeper_billing_informations_controller.rb:16:in `create'
actionpack (5.0.7.2) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.7.2) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.7.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.7.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:448:in `block (2 levels) in around'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:286:in `block (2 levels) in halting'
() var/lib/gems/2.5.0/bundler/gems/route_translator-9d3350d9574c/lib/route_translator/extensions/action_controller.rb:27:in `set_locale_from_url'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:382:in `block in make_lambda'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:285:in `block in halting'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:447:in `block in around'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.7.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.7.2) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.7.2) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.7.2) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.7.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.7.2) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.7.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.7.2) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
searchkick (2.3.0) lib/searchkick/logging.rb:209:in `process_action'
activerecord (5.0.7.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.7.2) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.7.2) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.7.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.7.2) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.7.2) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.7.2) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.7.2) lib/action_dispatch/routing/route_set.rb:727:in `call'
omniauth (1.4.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.4.1) lib/omniauth/strategy.rb:164:in `call'
bullet (5.5.0) lib/bullet/rack.rb:12:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.3) lib/rack/etag.rb:27:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.7.2) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
() var/lib/gems/2.5.0/bundler/gems/better_errors-707ffcf284d8/lib/better_errors/middleware.rb:84:in `protected_app_call'
() var/lib/gems/2.5.0/bundler/gems/better_errors-707ffcf284d8/lib/better_errors/middleware.rb:79:in `better_errors_call'
() var/lib/gems/2.5.0/bundler/gems/better_errors-707ffcf284d8/lib/better_errors/middleware.rb:57:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.7.2) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
rack (2.2.3) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.7.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
rack-livereload (0.3.16) lib/rack/livereload.rb:23:in `_call'
rack-livereload (0.3.16) lib/rack/livereload.rb:14:in `call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
rack-cors (0.4.1) lib/rack/cors.rb:81:in `call'
railties (5.0.7.2) lib/rails/engine.rb:522:in `call'
puma (3.7.0) lib/puma/configuration.rb:226:in `call'
puma (3.7.0) lib/puma/server.rb:578:in `handle_request'
puma (3.7.0) lib/puma/server.rb:415:in `process_client'
puma (3.7.0) lib/puma/server.rb:275:in `block in run'
puma (3.7.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
The methods are there but I don't understand why it gives me this error
I am getting this error on my rails application, i don't know where I called the controller_path that is undefined.
This is my session_controller.rb
class SessionsController < Devise::SessionsController
def new
super
end
def create
self.resource = warden.authenticate!(auth_options)
set_flash_message(:notice, :signed_in) if is_navigational_format?
sign_in(resource_name, resource)
if !session[:return_to].blank?
redirect_to session[:return_to]
session[:return_to] = nil
else
respond_with resource, :location => after_sign_in_path_for(resource)
end
end
end
The error is pointing at line 7
self.resource = warden.authenticate!(auth_options)
I dont know why or where I called what the error is referencing.
My full stacktrace is
devise (4.4.3) app/controllers/devise/sessions_controller.rb:48:in `auth_options'
devise (4.4.3) app/controllers/devise/sessions_controller.rb:19:in `create'
actionpack (4.2.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.10) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.10) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.10) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.10) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.10) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.10) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.10) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.10) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.10) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.10) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.10) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.10) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.10) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.10) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.10) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.10) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.10) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.10) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.10) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.10) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.10) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.10) lib/action_dispatch/routing/route_set.rb:817:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (1.6.10) lib/rack/etag.rb:24:in `call'
rack (1.6.10) lib/rack/conditionalget.rb:38:in `call'
rack (1.6.10) lib/rack/head.rb:13:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.10) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.10) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.10) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.10) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.10) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.10) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.10) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.10) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.10) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.10) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.10) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.10) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.10) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.10) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.10) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.10) lib/rack/lock.rb:17:in `call'
actionpack (4.2.10) lib/action_dispatch/middleware/static.rb:120:in `call'
rack (1.6.10) lib/rack/sendfile.rb:113:in `call'
railties (4.2.10) lib/rails/engine.rb:518:in `call'
railties (4.2.10) lib/rails/application.rb:165:in `call'
rack (1.6.10) lib/rack/lock.rb:17:in `call'
rack (1.6.10) lib/rack/content_length.rb:15:in `call'
rack (1.6.10) lib/rack/handler/webrick.rb:88:in `service'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
I just edited my question to include the stacktrace. Please let me know if there is any more of my code I have to post for you to completely help me trace my unknown error.
Hey all so Im creating an Api for my rails app to use with an android client but when im setting up the api im getting this error:
"uninitialized constant API::CoursesController"
app/controllers/api/courses_controller.rb
class API::CoursesController < ApplicationController::Base
courses = Course.all
render json: courses, status: 200
end
routes.rb
Rails.application.routes.draw do
resources :courses
resources :categories
resources :quizzes
resources :quiz_questions
resources :quiz_answers
namespace :api do
resources :courses
end
end
config/initializers/inflections.rb
ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym 'API'
end
when I go to the link http://localhost:3000/api/courses I get this:
uninitialized constant API::CoursesController
Rails.root: /Users/faisalchoura/Documents/uni/rocket/server
activesupport (4.2.3) lib/active_support/inflector/methods.rb:276:in `const_get'
activesupport (4.2.3) lib/active_support/inflector/methods.rb:276:in `block in constantize'
activesupport (4.2.3) lib/active_support/inflector/methods.rb:259:in `each'
activesupport (4.2.3) lib/active_support/inflector/methods.rb:259:in `inject'
activesupport (4.2.3) lib/active_support/inflector/methods.rb:259:in `constantize'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:72:in `controller_reference'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:62:in `controller'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:41:in `serve'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.3) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.3) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.3) lib/rails/engine.rb:518:in `call'
railties (4.2.3) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/Users/faisalchoura/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/faisalchoura/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/faisalchoura/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Can you help me please I've been stuck on this for a while now
Thanks!
Namespaces should be done with modules.
module API
class CoursesController < ApplicationController::Base
end
end
Just realized it was a silly mistake completely forgot to put the code in the index method and just left it in the class.
this
class API::CoursesController < ApplicationController
def index
courses = Course.all
render json: courses, status: 200
end
end
solved the problem
I have some problems with my ruby app.
I use:
Ruby = 2.0
Rails = 3.2
When i try to logout, i has an error like this bellow.
AbstractController::ActionNotFound - The action 'show' could not be found for UserSessionsController:
actionpack (3.2.17) lib/abstract_controller/base.rb:116:in process'
actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:inprocess'
actionpack (3.2.17) lib/action_controller/metal.rb:203:in dispatch'
actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.2.17) lib/action_controller/metal.rb:246:in block in action'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:indispatch'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in call'
journey (1.0.4) lib/journey/router.rb:68:inblock in call'
journey (1.0.4) lib/journey/router.rb:56:in call'
actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:incall'
bullet (4.1.4) lib/bullet/rack.rb:8:in call'
hirefire-resource (0.1.2) lib/hirefire/middleware.rb:27:incall'
newrelic_rpm (3.6.2.96) lib/new_relic/rack/error_collector.rb:12:in call'
newrelic_rpm (3.6.2.96) lib/new_relic/rack/agent_hooks.rb:18:incall'
newrelic_rpm (3.6.2.96) lib/new_relic/rack/browser_monitoring.rb:16:in call'
newrelic_rpm (3.6.2.96) lib/new_relic/rack/developer_mode.rb:28:incall'
request_store (1.0.5) lib/request_store/middleware.rb:9:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
rack (1.4.5) lib/rack/etag.rb:23:in call'
rack (1.4.5) lib/rack/conditionalget.rb:25:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:in call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:incall'
activerecord (3.2.17) lib/active_record/query_cache.rb:64:in call'
activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:in block in call'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:inrun_4032778647788681780_call_3401891405258349156__callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:405:in __run_callback'
activesupport (3.2.17) lib/active_support/callbacks.rb:385:in_run_call_callbacks'
activesupport (3.2.17) lib/active_support/callbacks.rb:81:in run_callbacks'
actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/reloader.rb:65:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:incall'
better_errors (0.9.0) lib/better_errors/middleware.rb:84:in protected_app_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:79:inbetter_errors_call'
better_errors (0.9.0) lib/better_errors/middleware.rb:56:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:in call'
railties (3.2.17) lib/rails/rack/logger.rb:32:incall_app'
railties (3.2.17) lib/rails/rack/logger.rb:16:in block in call'
activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:intagged'
railties (3.2.17) lib/rails/rack/logger.rb:16:in call'
actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:incall'
rack (1.4.5) lib/rack/methodoverride.rb:21:in call'
rack-contrib (1.1.0) lib/rack/contrib/runtime.rb:18:incall'
activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:in call'
rack (1.4.5) lib/rack/lock.rb:15:incall'
actionpack (3.2.17) lib/action_dispatch/middleware/static.rb:63:in call'
railties (3.2.17) lib/rails/engine.rb:484:incall'
railties (3.2.17) lib/rails/application.rb:231:in call'
rack (1.4.5) lib/rack/content_length.rb:14:incall'
railties (3.2.17) lib/rails/rack/log_tailer.rb:17:in call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:inservice'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/httpserver.rb:138:in service'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/httpserver.rb:94:inrun'
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
This is my routes.rb:
root to: 'user_session#new'
match '/user_sessions/new' => redirect('/user_session/new')
enter code here
controller :user_sessions do
get 'user_session/new' => :new, as: 'new_user_session'
get 'user_session/edit' => :edit, as: 'edit_user_session'
get 'user_session' => :show, as: 'user_session'
put 'user_session' => :update
delete 'user_session' => :destroy
post 'user_session' => :create
end
And also put this to user_session_controller.rb
def destroy
current_user_session.destroy
redirect_to new_user_session_url
end
I am having an issue were I keep getting this timeout for Faraday. I don't know what the issue is. I could really use some help here. This failing on a redirect. I am not sure what is causing the issue. I have been trying to fix this for 4 whole days and nothing seems to work. There is very little documentation on Faraday so I am hoping that someone has seen this before.
Is anyone able to help with this error? Is more information needed?
Faraday::Error::TimeoutError (Timeout::Error):
/usr/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill'
/usr/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
/usr/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
/usr/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
/usr/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
/usr/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `catch'
/usr/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'
/usr/lib/ruby/1.9.1/net/http.rb:1293:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
/usr/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'
/usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
/usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
rest-client (1.6.7) lib/restclient/net_http_ext.rb:51:in `request'
faraday (0.8.4) lib/faraday/adapter/net_http.rb:74:in `perform_request'
faraday (0.8.4) lib/faraday/adapter/net_http.rb:37:in `call'
faraday (0.8.4) lib/faraday/request/url_encoded.rb:14:in `call'
faraday (0.8.4) lib/faraday/connection.rb:226:in `run_request'
oauth2 (0.8.0) lib/oauth2/client.rb:88:in `request'
oauth2 (0.8.0) lib/oauth2/client.rb:131:in `get_token'
oauth2 (0.8.0) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:100:in `build_access_token'
omniauth-oauth2 (1.1.0) lib/omniauth/strategies/oauth2.rb:75:in `callback_phase'
omniauth (1.1.1) lib/omniauth/strategy.rb:219:in `callback_call'
omniauth (1.1.1) lib/omniauth/strategy.rb:175:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
airbrake (3.1.7) lib/airbrake/rails/middleware.rb:15:in `call'
exception_notification (2.6.1) lib/exception_notifier.rb:34:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.5) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__2705598145907853404__call__3655850838898635033__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
airbrake (3.1.7) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.1.7) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/utils.rb:470:in `safe_fork'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:180:in `start'
/usr/lib/ruby/1.9.1/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/lib/ruby/1.9.1/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'
If you need more information on what's happening, you can make faraday log to stdout, which means you can see what's happening and what http calls are being made. The error is happening with OAuth2, so you need to look into why it's timing out.
I'd recommend you run this on your repo:
bundle install --path vendor/bundle
Then, go into the vendor/bundle folder, into the oauth2 folder, and add the line
connection.response :logger if ENV['DEBUG']
to client.rb, within the def request(verb, url, opts={}) method.
Then, whatever command you are using to run phusion-passenger add DEBUG=true to the start of it.
Long answer I know, but should help diagnose what the faraday issue is!