Can't initialize local server for my Rails apps - ruby-on-rails

My rails apps have been freaking out on me lately. I start my local server by running "ruby script/server" like normal. The server starts, but when I try to access it via "http://localhost:3000/", it throws me a 500 error. This happens for all my rails apps, even the old ones I've left unchanged for several months now. Here is the full trace:
/!\ FAILSAFE /!\ 2010-02-17 23:34:46 -0800
Status: 500 Internal Server Error
uninitialized constant FFI::Platform::CPU
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:436:in `load_missing_constant'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
/Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:50:in `<module:Platform>'
/Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:32:in `<module:FFI>'
/Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/platform.rb:29:in `<top (required)>'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi/ffi.rb:42:in `<top (required)>'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Users/elpizochoi/.gem/ruby/1.9.1/gems/ffi-0.6.2/lib/ffi.rb:11:in `<top (required)>'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/sqlite3-0.0.8/lib/sqlite3.rb:1:in `<top (required)>'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:7:in `block in require_library_or_gem'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'
/opt/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:8:in `synchronize'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `block in call'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/opt/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
/opt/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/opt/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/opt/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Configuration: I have Ruby 1.9 installed with MacPorts, and am running on Rails 2.3.5.
Some things I've been playing with recently:
- Messed with RVM
- Tried out the Homebrew, a MacOSX package management system
- Installed Unicorn and Thin as gems
Any help would be much appreciated! I'd prefer not to have to scrap my system and reinstall everything.

When I get the " uninitialized constant" error, I normally have a missing class or library, e.g. an incomplete checkout of a project or branch. In your case there might be some problems with the path/setup of FFI::Platform::CPU
BTW you are mentioning: "not to have to scrap my system and reinstall everything" --> I use git to version control my dev environment once in a while, so I can checkout the previous snapshot before the trouble got started.
good luck!

Related

rake aborted plugin for redmine

I am trying to install a plugin for redmine version 5.0.1
an error occurs during the installation process, while if installed on redmine version 4.2.6, the plugin is installed correctly. What could be the problem
this plugin https://github.com/credativUK/redmine_email_inline_images
error
WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
rake aborted!
LoadError: cannot load such file -- redmine_email_inline_images/mail_handler_patch
/usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/src/redmine/plugins/redmine_email_inline_images/init.rb:2:in `<top (required)>'
/usr/src/redmine/lib/redmine/plugin_loader.rb:31:in `load'
/usr/src/redmine/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/usr/src/redmine/lib/redmine/plugin_loader.rb:108:in `each'
/usr/src/redmine/lib/redmine/plugin_loader.rb:108:in `block in load'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:427:in `instance_exec'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:603:in `catch'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:199:in `block in halting'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `each'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `invoke_before'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:105:in `run_callbacks'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/reloader.rb:88:in `prepare!'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `instance_exec'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `run'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/initializable.rb:60:in `run_initializers'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/application.rb:391:in `initialize!'
/usr/src/redmine/config/environment.rb:16:in `<top (required)>'
/usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:332:in `block in require'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/local/bundle/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:332:in `require'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/application.rb:367:in `require_environment!'
/usr/local/bundle/gems/railties-6.1.6/lib/rails/application.rb:533:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate_plugins => redmine:plugins:migrate => environment
install command rake db:migrate_plugins RAILS_ENV=production
Due to the upgrade to Rails 6.1 and their zeitwerk autoloader, plugins not written specifically for Redmine 5.0 (or upgraded with the required compatibility changes) will not work with Redmine 5.
The best article I could find for updating your plugins to Redmine 5 is here and unfortunately is is both in Japanese (I used Google translate) as well as does not cover how to upgrade things that a lot of projects need, such as database migration and hook loading.

Rails console only - Classes don't load (uninitialized constant)

I am having the weirdest error. SOMETIMES (usually after a code push), I will SSH into our production RoR servers and load up a console. When that happens, I get a crazy NameError error, then I try again and the console loads, but I cant use any of my classes
ubuntu#ip-10-0-1-10 /v/w/numanage> rails c -e production
/home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:268:in `const_get': uninitialized constant AdminUser
Did you mean? Admin (NameError)
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:268:in `block in constantize'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `inject'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `constantize'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:583:in `get'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:614:in `constantize'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise.rb:301:in `get'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/mapping.rb:81:in `to'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/mapping.rb:76:in `modules'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/mapping.rb:93:in `routes'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/mapping.rb:160:in `default_used_route'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/mapping.rb:70:in `initialize'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise.rb:331:in `new'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise.rb:331:in `add_mapping'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/rails/routes.rb:241:in `block in devise_for'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/rails/routes.rb:240:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/devise-4.2.0/lib/devise/rails/routes.rb:240:in `devise_for'
from /var/www/numanage/config/routes.rb:12:in `block in <top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `instance_exec'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:389:in `eval_block'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:371:in `draw'
from /var/www/numanage/config/routes.rb:1:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `load'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/file_update_checker.rb:77:in `execute'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/routes_reloader.rb:7:in `execute'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/application/finisher.rb:132:in `block (2 levels) in <module:Finisher>'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:396:in `instance_exec'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:396:in `block in make_lambda'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:547:in `block (2 levels) in default_terminator'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:546:in `catch'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:546:in `block in default_terminator'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:170:in `block in halting'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:454:in `block in call'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:454:in `each'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:454:in `call'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_run_callbacks'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/execution_wrapper.rb:99:in `run!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/reloader.rb:113:in `run!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/reloader.rb:48:in `block (2 levels) in reload!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/reloader.rb:46:in `tap'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/reloader.rb:46:in `block in reload!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/execution_wrapper.rb:76:in `wrap'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/reloader.rb:45:in `reload!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:154:in `serve'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
ubuntu#ip-10-0-1-10 /v/w/numanage> rails c -e production
Running via Spring preloader in process 4926
Loading production environment (Rails 5.0.0.1)
2.3.1 :001 > User
NameError: uninitialized constant User
from (irb):2
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /var/www/numanage/bin/rails:9:in `<top (required)>'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `load'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `call'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/command_wrapper.rb:38:in `call'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:191:in `block in serve'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:161:in `fork'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:161:in `serve'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.3.1#numanage/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
2.3.1 :003 >
The really crazy part is, the puma server starts up just fine and acts like nothings wrong
I'm really at a lost to even debug this, let me know if y'all have any ideas
EDIT:
We are using the devise and ActiveAdmin gems, so the routes.rb:12 is as follows
devise_for :admin_users, ActiveAdmin::Devise.config
It looks like devise is loading out AdminUser (ActiveRecord model), which is failing for some unknown reason

Can't eagerload classes | Rails 4.2.5

Rails: 4.2.5
I'm using STI and needed to get all Subclasses.
But as in dev environment, rails does Lazy Loading. So Model.subclasses and Model.descendants always return []
Googling sent me to this issue: https://github.com/rails/rails/issues/3364
And the above issue suggested following solution to put as initializer:
ActionDispatch::Reloader.to_prepare do
Rails.application.eager_load!
end
And on that I'm getting following exception:
/Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:120:in `rescue in block in validates': Unknown validator: 'PersenceValidator' (ArgumentError)
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:117:in `block in validates'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:113:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activemodel-4.2.5/lib/active_model/validations/validates.rb:113:in `validates'
from /Users/vmac1/rails_projects/survd/app/models/sub_service.rb:7:in `<class:SubService>'
from /Users/vmac1/rails_projects/survd/app/models/sub_service.rb:1:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:494:in `load_missing_constant'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:184:in `const_missing'
from /Users/vmac1/rails_projects/survd/app/models/buffet_service.rb:1:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:457:in `block in load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:647:in `new_constants_in'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:456:in `load_file'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:354:in `require_or_load'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:317:in `depend_on'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:233:in `require_dependency'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!'
from /Users/vmac1/rails_projects/survd/config/initializers/eagerload_subclasses.rb:2:in `block in <top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:446:in `instance_exec'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:446:in `block in make_lambda'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:192:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:192:in `block in simple'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `block in call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:504:in `call'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:778:in `_run_prepare_callbacks'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/actionpack-4.2.5/lib/action_dispatch/middleware/reloader.rb:55:in `prepare!'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/application/finisher.rb:50:in `block in <module:Finisher>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!'
from /Users/vmac1/rails_projects/survd/config/environment.rb:5:in `<top (required)>'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:92:in `preload'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:143:in `serve'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:131:in `block in run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:125:in `loop'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application.rb:125:in `run'
from /Users/vmac1/.rvm/gems/ruby-2.2.3/gems/spring-1.6.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/vmac1/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
As others have said, the actual error is a validation typo. But in regards to the original problem, Rails 4.2 eager-loads all classes in production by default, so you'd just have to change the eager_load and cache_classes setting in your other environments to get the same behavior. However, this will make development much more unpleasant since you'll have to restart the server every time you make a code change.
What is the underlying problem you're trying to solve by listing all subclasses? There might be another design that would avoid that requirement.
Typo of persence instead of presence

Rails app crashes on Heroku after implementing ElasticSearch

I just implemented ElasticSearch to my Rails App. Everything is working localy, but when I deployed my changes to Heroku, the app crashes.
When I run
heroku run rails c
in the Heroku cli, I get this error message:
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:878:in `initialize': Connection refused - connect(2) (Faraday::ConnectionFailed)
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:878:in `open'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:877:in `connect'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:851:in `start'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:1367:in `request'
from /app/vendor/bundle/ruby/2.0.0/gems/faraday- 0.9.0/lib/faraday/adapter/net_http.rb:80:in `perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/faraday- 0.9.0/lib/faraday/adapter/net_http.rb:39:in `call'
from /app/vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in `build_response'
from /app/vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in `run_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-transport-1.0.4/lib/elasticsearch/transport/transport/http/faraday.rb:21:in `block in perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-transport-1.0.4/lib/elasticsearch/transport/transport/base.rb:187:in `call'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-transport-1.0.4/lib/elasticsearch/transport/transport/base.rb:187:in `perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-transport-1.0.4/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-transport-1.0.4/lib/elasticsearch/transport/client.rb:102:in `perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-api-1.0.4/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
from /app/vendor/bundle/ruby/2.0.0/gems/elasticsearch-api-1.0.4/lib/elasticsearch/api/actions/indices/create.rb:77:in `create'
from /app/app/models/publication.rb:67:in `<top (required)>'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:348:in `require_or_load'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:307:in `depend_on'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:225:in `require_dependency'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:468:in `block (2 levels) in eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:467:in `each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:467:in `block in eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:465:in `each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:465:in `eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/engine.rb:346:in `eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application/finisher.rb:58:in `each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application/finisher.rb:58:in `block in <module:Finisher>'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /app/config/environment.rb:5:in `<top (required)>'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application.rb:264:in `require'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/application.rb:264:in `require_environment!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /app/bin/rails:8:in `require'
from /app/bin/rails:8:in `<main>'
On Heroku I installed the Bonsai ElasticSearch, but that didn't solve the problem.
I'm not that confident with ElasticSearch, did I forgot some configuration or something?
my repository is at:
https://github.com/acandael/posplus-rails
thanks for your help,
Anthony
The errors imply the app can't connect to Elasticsearch to create an index, so I would check if you can do that locally:
$ heroku config | grep BONSAI_URL
$ curl -XPUT '<your-bonsai-url>/myindex/'
If this fails, then the problem is with the Elasticsearch cluster. If it succeeds, then you're probably not pointing the app at the correct URL.

Error running ruby server

I am trying to run ruby server in ubuntu 12.04,rails 2.3.11,ruby 1.8.3 gem 1.5.3 and get this. Is this a dependencies issue.or configuration issue.Please help me. Thanks in advance.
root#virinchy-Aspire-4535:~/BBYIDX-2/BBYIDX-master# script/server
=> Booting WEBrick
=> Rails 2.3.18 application starting on http:/0.0.0.0:3000
Faraday: you may want to install system_timer for reliable timeouts
/usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `initialize':
Is there something i need to fix here
FATAL: role "bbyidx" does not exist (PGError)
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/base.rb:1299:in `table_exists?'
from /home/virinchy/BBYIDX-2/BBYIDX-master/app/models/user.rb:73
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:405:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:285:in `require_or_load'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:106:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:118:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:364:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:157:in `observed_class'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:183:in `observed_classes'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:166:in `initialize'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `new'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `instance'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:38:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `evaluate_method'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:166:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:276:in `run_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:631:in `prepare_dispatcher'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:185:in `process'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
from /home/virinchy/BBYIDX-2/BBYIDX-master/config/environment.rb:22
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/commands/server.rb:84
from script/server:3:in `require'
from script/server:3
This is your issue:
FATAL: role "bbyidx" does not exist (PGError)
You're attempting to connect to your PostgreSQL database using a role that doesn't exist. You can create this role by using the createuser command in your terminal.
createuser bbyidx

Resources