Error loading mysql2 when trying to run ruby app on localhost - ruby-on-rails

I'm trying to run a ruby app i cloned from github on mylocalhost and get the following error when entering 'rails s' in the command:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not be found. - C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
from C:/Users/uklar/Documents/GitHub/Budget-Requests-New/config/application.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
C:\Users\uklar\Documents\GitHub\Budget-Requests-New [master +0 ~2 -0]>
Any ideas? Thanks!
Update: After downloading the libmysql.dll file and putting it in my ruby directory i get these messages:
=> Booting Thin
=> Rails 3.2.2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/http/mime_type.rb:102: warning: already initialized constant JSON
Exiting
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/client.rb:44:in `connect': Can't connect to MySQL server on 'localhost' (10061) (Mysql2::Error)
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/client.rb:44:in `initialize'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/model_schema.rb:308:in `clear_cache!'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:418:in `_run__435324379__prepare__609126447__callbacks'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from c:/users/uklar/documents/github/budget-requests-new/config/environment.rb:5:in `<top (required)>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from c:/users/uklar/documents/github/budget-requests-new/config.ru:4:in `block in <main>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from c:/users/uklar/documents/github/budget-requests-new/config.ru:1:in `new'
from c:/users/uklar/documents/github/budget-requests-new/config.ru:1:in `<main>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands/server.rb:46:in `app'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands/server.rb:70:in `start'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:55:in `block in <top (required)>'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Ok, so solution was:
Download libmysql.dll file and put it in ruby directory
open command prompt as administratoe and start the mysql server the following way:
C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld

Related

Rails: Couldn't load the Unicode tables for UTF8Handler

I'm on a fresh Ubuntu 17.10 machine, Ruby 2.2.3 installed with RVM, and I'm trying to run a Rails 4.2 application.
After rails s command I get:
davide#davidell:~/app/app-backend$ rails s
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH"=>["/home/davide/.rvm/gems/ruby-2.2.3#app", "/home/davide/.rvm/gems/ruby-2.2.3#global"]}) was passed in from bin/rails:3:in `load'
=> Booting Puma
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:338:in `rescue in load': Couldn't load the Unicode tables for UTF8Handler (undefined method `getbyte' for false:FalseClass), ActiveSupport::Multibyte is unusable (IOError)
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:335:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:326:in `codepoints'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:147:in `block in decompose'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:136:in `each'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:136:in `inject'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:136:in `decompose'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/multibyte/unicode.rb:270:in `normalize'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/inflector/transliterate.rb:62:in `transliterate'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/inflector/transliterate.rb:83:in `parameterize'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/core_ext/string/inflections.rb:168:in `parameterize'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/scope.rb:35:in `initialize'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/resource/scopes.rb:34:in `new'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/resource/scopes.rb:34:in `scope'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/resource_dsl.rb:22:in `scope'
from /home/davide/app/app-backend/app/admin/venue.rb:28:in `block in <top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/dsl.rb:15:in `instance_exec'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/dsl.rb:15:in `run_registration_block'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/namespace.rb:223:in `parse_registration_block'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/namespace.rb:48:in `register'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:151:in `register'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin.rb:75:in `register'
from /home/davide/app/app-backend/app/admin/venue.rb:1:in `<top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:209:in `block in load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/error.rb:41:in `capture'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:209:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:201:in `block in load!'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:201:in `each'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:201:in `load!'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin/application.rb:223:in `routes'
from /home/davide/.rvm/gems/ruby-2.2.3#app/bundler/gems/activeadmin-893b46c6530c/lib/active_admin.rb:79:in `routes'
from /home/davide/app/app-backend/config/routes.rb:320:in `block (2 levels) in <top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/mapper.rb:940:in `block in constraints'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/mapper.rb:816:in `scope'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/mapper.rb:940:in `constraints'
from /home/davide/app/app-backend/config/routes.rb:316:in `block in <top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:434:in `instance_exec'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:434:in `eval_block'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/actionpack-4.2.4/lib/action_dispatch/routing/route_set.rb:412:in `draw'
from /home/davide/app/app-backend/config/routes.rb:1:in `<top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/file_update_checker.rb:75:in `call'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /usr/share/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
from /home/davide/app/app-backend/config/environment.rb:5:in `<top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/davide/app/app-backend/config.ru:20:in `block in <main>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /home/davide/app/app-backend/config.ru:in `new'
from /home/davide/app/app-backend/config.ru:in `<main>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/server.rb:61:in `app'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/server.rb:78:in `start'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from /home/davide/app/app-backend/bin/rails:8:in `require'
from /home/davide/app/app-backend/bin/rails:8:in `<top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/client/rails.rb:28:in `call'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/client/command.rb:7:in `call'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/client.rb:28:in `run'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/bin/spring:49:in `<top (required)>'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `load'
from /home/davide/.rvm/gems/ruby-2.2.3#app/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/davide/app/app-backend/bin/spring:13:in `require'
from /home/davide/app/app-backend/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
After several rails s tries, it works, but it's a totally random number of trials. If I stop the application, the same error occurs, and after several other tries, it works. So random.
Now I got:
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Rails could not translate host name "postgres" to address: Name or service not known (PG::ConnectionBad)

I'm working on a Rails 4.2.3 project with ruby 2.2.2 (Running ubuntu 16.04). It was working ok but after revisiting it after a while I can't serve. I've tried searching but all situations don't seem to be of help.
Here's the error log:
bigzoo#bigzoo:~/Documents/projects/proj$ rs
=> Booting Puma
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `initialize': could not translate host name "postgres" to address: Name or service not known (PG::ConnectionBad)
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `new'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `connect'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_handling.rb:87:in `connection'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/querying.rb:39:in `find_by_sql'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/relation.rb:638:in `exec_queries'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/relation.rb:514:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/relation.rb:243:in `to_a'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/relation/delegation.rb:46:in `map'
from /home/bigzoo/Documents/projects/proj/app/admin/product.rb:62:in `block in <top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/dsl.rb:15:in `instance_exec'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/dsl.rb:15:in `run_registration_block'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/namespace.rb:223:in `parse_registration_block'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/namespace.rb:48:in `register'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:154:in `register'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin.rb:75:in `register'
from /home/bigzoo/Documents/projects/proj/app/admin/product.rb:1:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:212:in `block in load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/error.rb:41:in `capture'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:212:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:204:in `block in load!'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:204:in `each'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:204:in `load!'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin/application.rb:226:in `routes'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/bundler/gems/activeadmin-21f76b1faf65/lib/active_admin.rb:79:in `routes'
from /home/bigzoo/Documents/projects/proj/config/routes.rb:20:in `block in <top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:434:in `instance_exec'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:434:in `eval_block'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:412:in `draw'
from /home/bigzoo/Documents/projects/proj/config/routes.rb:1:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/file_update_checker.rb:75:in `call'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
from /home/bigzoo/Documents/projects/proj/config/environment.rb:5:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /home/bigzoo/Documents/projects/proj/config.ru:3:in `block in <main>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
from /home/bigzoo/Documents/projects/proj/config.ru:in `new'
from /home/bigzoo/Documents/projects/proj/config.ru:in `<main>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/server.rb:208:in `app'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/rack-1.6.5/lib/rack/server.rb:336:in `wrapped_app'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:78:in `start'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/bin/rails:8:in `require'
from /home/bigzoo/Documents/projects/proj/bin/rails:8:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `call'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/client/command.rb:7:in `call'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/client.rb:26:in `run'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/bin/spring:48:in `<top (required)>'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `load'
from /home/bigzoo/Documents/projects/proj/.bundle/ruby/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/bigzoo/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/bigzoo/Documents/projects/proj/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
The only issue seems to be connecting to postgres.
PS. I've already tried running unset DATABASE_URL if anyone is feeling compelled to suggest that.
Extra info:
bigzoo#bigzoo:~/Documents/projects/proj$ sudo netstat -atpn | grep 5432
[sudo] password for bigzoo:
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1744/postgres
Adding the line below to /etc/hosts did the trick.
127.0.0.1 postgres
did the trick.
Rails uses the host name postgres and leaves it up to the system to direct postgres to the host and port as required. The line above allows the mapping to take place if it doesn't work for some reason.
Credits #mudasobwa.
PS.
To edit /etc/hosts just type (in your console)
sudo nano /etc/hosts
To open it and add the line.
This happened to me on a container that I had been using regularly. It just randomly started throwing this error and not resolving.
I eventually solved it with
docker system prune --volumes
running it without the volumes flag didn't resolve it.
if you run with docker add :
services:
postgres:
image: postgres
environment:
POSTGRES_HOST_AUTH_METHOD: trust

rails server command show errors

I am using Rails 3.2.15 and Ruby 2.3.1 on my Ubuntu system. Whenever I am trying to start server, I am getting these errors.
rails server
/var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/values/time_zone.rb:270:
warning: circular argument reference - now
=> Booting WEBrick
=> Rails 3.2.15 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Unsupported version: 2.2.11
For more information, read the documentation:http://pat.github.com/ts/en/advanced_config.html
Exiting
/var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) (Mysql2::Error)
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `initialize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:310:in `clear_cache!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/railtie.rb:103:in `block (2 levels) in <class:Railtie>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:418:in `_run__4005937425673360809__prepare__505669176022602409__callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:405:in `__run_callback'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config/environment.rb:5:in `<top (required)>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:3:in `block in <main>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:in `new'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:in `<main>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands/server.rb:46:in `app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands/server.rb:70:in `start'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:55:in `block in <top (required)>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:7:in `require'
from script/rails:7:in `<main>'
Add this to your gem file
gem 'riddle', '1.5.1'
gem 'thinking-sphinx', '2.0.11', :require => "thinking_sphinx"
and run bundle

Can't start server

Cloned project from heroku and installed all gems with bundle.
That is what my server say to me.
$ rails s
=> Booting Puma
=> Rails 4.2.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:176:in `split': bad URI(is not URI?): (URI::InvalidURIError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:211:in `parse'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
from /Library/Ruby/Gems/2.0.0/gems/pusher-0.15.1/lib/pusher/client.rb:53:in `url='
from /Users/abdullahatkaev/the247clinic/config/initializers/pusher.rb:1:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `block in load'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:268:in `load'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/notifications.rb:166:in `instrument'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:651:in `load_config_initializer'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:615:in `each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
from /Users/abdullahatkaev/the247clinic/config/environment.rb:5:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
from /Users/abdullahatkaev/the247clinic/config.ru:3:in `block in <main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/abdullahatkaev/the247clinic/config.ru:in `new'
from /Users/abdullahatkaev/the247clinic/config.ru:in `<main>'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
from /Library/Ruby/Gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/abdullahatkaev/the247clinic/bin/rails:8:in `require'
from /Users/abdullahatkaev/the247clinic/bin/rails:8:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/abdullahatkaev/the247clinic/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Anybody knows how to fix it?
Maybe i should to do something more then only bundle. I am just starting, sorry if its to easy.
You are missing configuration variable(s) and the pusher initializer cannot read the url, because its missing an url. You see it this line from your backtrace:
from /Users/abdullahatkaev/the247clinic/config/initializers/pusher.rb:1:in `<top (required)>'
Check this file to see what you need exactly. It depends on your project how you can set the url. Either through rails or something like dotenv.

Error with activerecord -3.1.11 Could not find table (ActiveRecord::Statement Invalid)

Before push my app to heroku, I tested my app in production mode, it works perfectly if its in the development mode, but in production mode I'm getting following error activerecord -3.1.11 Could not find table (ActiveRecord::Statement Invalid).
How to fix this error?
I'm sure that table 'pages' exists.
C:\Sites\ecozap>rails s -e production
=> Booting WEBrick
=> Rails 3.1.11 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/connection_ad
apters/sqlite_adapter.rb:450:in `table_structure': Could not find table 'pages' (ActiveRecord::Statement
Invalid)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/
connection_adapters/sqlite_adapter.rb:333:in `columns'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/
connection_adapters/abstract/connection_pool.rb:95:in `block (2 levels) in initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/
connection_adapters/abstract/connection_pool.rb:92:in `block in initialize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:712:in `yield'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:712:in `default'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:712:in `columns'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:728:in `column_names'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:741:in `column_methods_hash'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:1118:in `all_attributes_exists?'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/base.rb:892:in `respond_to?'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/named_scope.rb:193:in `valid_scope_name?'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.1.11/lib/active_record/named_scope.rb:175:in `scope'
from C:/Sites/ecozap/app/models/page.rb:22:in `<class:Page>'
from C:/Sites/ecozap/app/models/page.rb:21:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:348:in `require_or_load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:489:in `load_missing_constant'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:181:in `block in const_missing'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:179:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:179:in `const_missing'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/inflector/methods.rb:124:in `block in constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/inflector/methods.rb:123:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/inflector/methods.rb:123:in `constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.1.11/lib/action_controller/metal/params_wrapper.rb:148:in `_default_wrap_model'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.1.11/lib/action_controller/metal/params_wrapper.rb:167:in `_set_wrapper_defaults'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.1.11/lib/action_controller/metal/params_wrapper.rb:128:in `inherited'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.1.11/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.1.11/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from C:/Sites/ecozap/app/controllers/pages_controller.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:225:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:348:in `require_or_load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:302:in `depend_on'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:214:in `require_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/engine.rb:417:in `block (2 levels) in eager_load!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/engine.rb:416:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/engine.rb:416:in `block in eager_load!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/engine.rb:414:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/engine.rb:414:in `eager_load!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/application/finisher.rb:51:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/initializable.rb:54:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/initializable.rb:54:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/application.rb:96:in `initialize!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Sites/ecozap/config/environment.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:640:in `new_constants_in'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:223:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.1.11/lib/active_support/dependencies.rb:240:in `require'
from C:/Sites/ecozap/config.ru:8:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/builder.rb:51:in`instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/builder.rb:51:in`initialize'
from C:/Sites/ecozap/config.ru:in `new'
from C:/Sites/ecozap/config.ru:in `<main>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/builder.rb:40:in`eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/builder.rb:40:in`parse_file'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/server.rb:200:in`app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/commands/server.rb:46:in `app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/server.rb:304:in`wrapped_app'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.3.10/lib/rack/server.rb:254:in`start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/commands/server.rb:70:in `start'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/commands.rb:54:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/commands.rb:49:in `tap'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.1.11/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Right, your table exists, but probably only in development database. It doesn't exist in production database, which is different by default.
You should either run
RAILS_ENV=production bundle exec rake db:migrate
to migrate your production database or edit database.yml file to set your production database to be the same as development database.

Resources