Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't run rails server within a DB-driven rails project; can't view localhost
    primarykey
    data
    text
    <p>I'm able to create a "rails new demoproject" and run "rails s" successfully within the folder, however when I try and create a rails project with a DB "rails new demoproject -d mysql" and run "rails s" within the folder I get the following error:</p> <pre><code>user$ rails server =&gt; Booting WEBrick =&gt; Rails 4.0.0.beta1 application starting in development on http://0.0.0.0:3000 =&gt; Call with -d to detach =&gt; Ctrl-C to shutdown server [2013-04-20 16:06:26] INFO WEBrick 1.3.1 [2013-04-20 16:06:26] INFO ruby 1.9.3 (2013-02-22) [x86_64-darwin12.3.0] [2013-04-20 16:06:26] INFO WEBrick::HTTPServer#start: pid=1945 port=3000 Started GET "/" for 127.0.0.1 at 2013-04-20 16:06:39 -0400 Mysql2::Error (Access denied for user 'root'@'localhost' (using password: NO)): mysql2 (0.3.11) lib/mysql2/client.rb:44:in `connect' mysql2 (0.3.11) lib/mysql2/client.rb:44:in `initialize' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `new_connection' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:456:in `checkout_new_connection' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:427:in `acquire_connection' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `block in checkout' /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:363:in `checkout' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:273:in `block in connection' /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:272:in `connection' activerecord (4.0.0.beta1) lib/active_record/connection_adapters/abstract/connection_pool.rb:552:in `retrieve_connection' activerecord (4.0.0.beta1) lib/active_record/connection_handling.rb:79:in `retrieve_connection' activerecord (4.0.0.beta1) lib/active_record/connection_handling.rb:53:in `connection' activerecord (4.0.0.beta1) lib/active_record/migration.rb:739:in `current_version' activerecord (4.0.0.beta1) lib/active_record/migration.rb:747:in `needs_migration?' activerecord (4.0.0.beta1) lib/active_record/migration.rb:357:in `check_pending!' activerecord (4.0.0.beta1) lib/active_record/migration.rb:346:in `block in call' activesupport (4.0.0.beta1) lib/active_support/logger_silence.rb:16:in `silence' activerecord (4.0.0.beta1) lib/active_record/migration.rb:345:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.0.0.beta1) lib/active_support/callbacks.rb:373:in `_run__3314375952420028571__call__callbacks' activesupport (4.0.0.beta1) lib/active_support/callbacks.rb:78:in `run_callbacks' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/reloader.rb:64:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.0.0.beta1) lib/rails/rack/logger.rb:38:in `call_app' railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `block in call' activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `block in tagged' activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:25:in `tagged' activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `tagged' railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' rack (1.5.2) lib/rack/runtime.rb:17:in `call' activesupport (4.0.0.beta1) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' actionpack (4.0.0.beta1) lib/action_dispatch/middleware/static.rb:64:in `call' railties (4.0.0.beta1) lib/rails/engine.rb:510:in `call' railties (4.0.0.beta1) lib/rails/application.rb:96:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' rack (1.5.2) lib/rack/content_length.rb:14:in `call' rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' Rendered /Users/user/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.0ms) Rendered /Users/user/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms) Rendered /Users/user/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms) Rendered /Users/user/.rvm/gems/ruby-1.9.3-p392/gems/actionpack-4.0.0.beta1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (51.9ms) </code></pre> <p>And when I go to localhost:3000 I get a "Action Controller: Exception caught" error in the heading of the web browser and a mysql2 error on the web page which can be viewed here: <a href="http://postimg.org/image/9wemvhwkj/" rel="nofollow">http://postimg.org/image/9wemvhwkj/</a> </p> <p><strong>update</strong>: Here is what was in the database.yml file...</p> <pre><code># MySQL. Versions 4.1 and 5.0 are recommended. # # Install the MYSQL driver # gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem 'mysql2' # # And be sure to use new-style password hashing: # http://dev.mysql.com/doc/refman/5.0/en/old-client.html development: adapter: mysql2 encoding: utf8 database: cms_development pool: 5 username: root password: socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 encoding: utf8 database: cms_test pool: 5 username: root password: socket: /tmp/mysql.sock production: adapter: mysql2 encoding: utf8 database: cms_production pool: 5 username: root password: socket: /tmp/mysql.sock </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload