1
votes

i am new in Ruby on Rails, so sorry for the question, it might be pretty easy, but..

So, here is my problem: i have Ubuntu 12.04 with RoR on it. I am taking part in some project, so i've checked out svn, installed bundle, and now i have problems with rails server. Here is the log from terminal


    public is no longer used to avoid overloading Module#public, use :public_folder instead
    from /usr/lib/ruby/gems/1.8/gems/web_translate_it-1.7.1.3/lib/web_translate_it/server.rb:12
    DEPRECATION WARNING: require "activerecord" is deprecated and will be removed in Rails 3. Use require "active_record" instead. (called from /usr/lib/ruby/vendor_ruby/activerecord.rb:2)
    => Booting WEBrick
    => Rails 3.2.12 application starting in development on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    Exiting
    /usr/lib/ruby/gems/1.8/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'fubademoall'@'localhost' (using password: YES) (Mysql2::Error)
        from /usr/lib/ruby/gems/1.8/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `send'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `checkout'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `checkout'
        from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `connection'
        from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/model_schema.rb:308:in `clear_cache!'
        from /usr/lib/ruby/gems/1.8/gems/activerecord-3.2.12/lib/active_record/railtie.rb:97:in `_callback_before_3'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:418:in `_run__1552657550__prepare__4__callbacks'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `send'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `send'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
        from /usr/lib/ruby/gems/1.8/gems/actionpack-3.2.12/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
        from /usr/lib/ruby/gems/1.8/gems/actionpack-3.2.12/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/application/finisher.rb:47
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `run_initializers'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `send'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require'

Thank you in advice!

3
up your ruby to version 1.9.3itsnikolay

3 Answers

3
votes

There's an error connecting to the MySQL database:

/usr/lib/ruby/gems/1.8/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'fubademoall'@'localhost' (using password: YES) (Mysql2::Error)

Check that the configuration in config/database.yml matches up with the database credentials on the MySQL server that you're using.

1
votes
If you are new Please see following eg: for creating database, grant ,and database.yml file  

=> Go to Mysql :
D:\sandeep\Ruby Projects\simple_cms>mysql -u root -p
Enter password: ********

=>Create Database :
 create database simple_cms_development 

=>Gtanting the Access to database : 
 mysql> grant all privileges on simple_cms_development.*
     ->to 'simple_cms' @'localhost'
     -> identified by 'secretpassword';
Query OK, 0 rows affected (0.00 sec)

=>See Database and Grant :
 mysql> show grants for 'simple_cms' @'localhost';

=>And Your database.yml file like this :
development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_development
  pool: 5
  username: simple_cms
  password: secretpassword
  socket: /tmp/mysql.sock

test:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_test
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_production
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock
0
votes

I think the relevant line of the error message is:

`connect': Access denied for user 'fubademoall'@'localhost' (using password: YES) (Mysql2::Error)

Have you set mysql? Are the permissions correct?