I was having a rails application, and I want to deploy it in my new laptop ( with ruby and rails installed fresh).
After installing gems and all .. when i goto my rails application folder and ruby rails s
Error shows like :
/home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': FATAL: role "insane" does not exist (PG::Error)
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `new'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `connect'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:326:in `initialize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /home/insane/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /home/insane/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/railtie.rb:97:in `block (2 levels) in <class:Railtie>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__2015430698042624034__prepare__3529665547423141566__callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/insane/Rails/BACKUP/config/environment.rb:5:in `<top (required)>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /home/insane/Rails/BACKUP/config.ru:3:in `block in <main>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /home/insane/Rails/BACKUP/config.ru:in `new'
from /home/insane/Rails/BACKUP/config.ru:in `<main>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have gone through the below link , but even it dint help saying /Rails/BACKUP$ createdb insane
createdb: could not connect to database postgres: FATAL: role "insane" does not exist
(postgreSQL error) FATAL: role "demo" does not exist (PG::Error)`
Please help
You need a user in the database named insane.
Open up a terminal and do the following
(the $ and psql> denote the terminal type, not commands that you type)
$ psql template1
psql> CREATE USER insane WITH PASSWORD 'some_password';
That should create the user for you. Alternatively, if this is on a dev machine, you can just use
psql> CREATE USER insane superuser;
That will create the user insane with all permissions.
NOTE
You may first need to be logged in as the postgres user.
$ sudo su postgres
<password for your account>
You will not see your password being typed.
Then you will be able to use the first set of commands above.
Related
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
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
Just starting to get into RoR development and I am struggling with getting the Webrick server to start. I am in my rails project's folder. Then I enter rails server or rails s and it looks like the server is going to start then it says Exiting with a bunch of other stuff listed below it. Anyone know what is wrong?? Here is what terminal spits out...
wyep:simple_cms designer1$ rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'#'localhost' (using password: NO) (Mysql2::Error)
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /Users/designer1/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout' from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /Users/designer1/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Applications/MAMP/htdocs/simple_cms/config/environment.rb:5:in `<top (required)>'
from /Applications/MAMP/htdocs/simple_cms/config.ru:3:in `require'
from /Applications/MAMP/htdocs/simple_cms/config.ru:3:in `block in <main>'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Applications/MAMP/htdocs/simple_cms/config.ru:in `new'
from /Applications/MAMP/htdocs/simple_cms/config.ru:in `<main>'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/designer1/.rvm/gems/ruby-2.0.0-p195/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Error is in the message there:
Access denied for user 'root'#'localhost' (using password: NO) (Mysql2::Error)
In your config/database.yml you need to specify a valid host, user and password
So I've just installed postgreSQL with HomeBrew and have initialized my new demo_app with the: rails new demo_app -d postgresql command.
Albeit, I am getting the following error when starting up the server rails s.
Snippit:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': FATAL: role "demo" does not exist (PG::Error)
Full log:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': FATAL: role "demo" does not exist (PG::Error)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/anthonypanepinto/Sites/new_demo/demo/config/environment.rb:5:in `<top (required)>'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:3:in `require'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:in `new'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
When your create rails app, you must create a database with postgres for that it works.
createdb demo
And check your config/database.yml
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