Unable to connect to MySQL using ruby-mysql gem - mysql

I installed the ruby-mysql gem using bundler. But Mysql.connect is crashing with the following trace.
/home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `initialize': No such file or directory - /tmp/\
mysql.sock (Errno::ENOENT)
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `new'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:167:in `block in initialize'
from /home/kris/.rvm/rubies/ruby-1.9.3-p194-perf/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql/protocol.rb:164:in `initialize'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql.rb:114:in `new'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql.rb:114:in `connect'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/ruby-mysql-2.9.10/lib/mysql.rb:49:in `new'
from /home/kris/dev/dispatch/application.rb:38:in `<top (required)>'
from config.ru:1:in `require'
from config.ru:1:in `block in <main>'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/bin/thin:23:in `load'
from /home/kris/.rvm/gems/ruby-1.9.3-p194-perf#dispatch/bin/thin:23:in `<main>'
My machine is running Ubuntu 12.04 and i have libmysqlclient-dev already installed. How can i fix this problem ?
Thank You

I believe that you should just change socket in your database.yml.
Try changing it from
/tmp/mysql.sock
to
/var/run/mysqld/mysqld.sock

Related

MySQL gem is not installing on M1 mac

I am facing issue while installing MySQL gem on M1 mac. Bundle install fas failing to build mysql gem
An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
In Gemfile:
mysql2
Found a solution which suggested to install mysql2 gem using following command
$ arch -x86_64 gem install mysql2 -v 0.5.3 -- --srcdir=/usr/local/mysql/include
This actually solved bundle install issue, but when i tried rails c got this error.
$ rails c
/Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- mysql2/mysql2 (LoadError)
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `block in require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in `load_dependency'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/mysql2-0.5.3/lib/mysql2.rb:36:in `<main>'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler/runtime.rb:55:in `each'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler/runtime.rb:55:in `block in require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler/runtime.rb:44:in `each'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler/runtime.rb:44:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/bundler-2.3.8/lib/bundler.rb:176:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:92:in `require'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:92:in `preload'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
from /Users/maneeshb/.rvm/gems/ruby-2.6.9/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/maneeshb/.rvm/rubies/ruby-2.6.9/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/maneeshb/.rvm/rubies/ruby-2.6.9/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Please help me to solve this issue.
This solved the issue
brew install openssl zstd mysql
LIBRARY_PATH=$(brew --prefix zstd)/lib/:$(brew --prefix openssl)/lib/ gem install mysql2

Ruby on Rails installing - Ubuntu 15

I am trying to install RoR in Ubuntu 15(64 bit). I have done most of the installation process like installing rvm, ruby, mysql server, creating gemset.
rails new first_app
rvm gemset list
rvm gemset use rails3.2.13
rails new first_app
cd first_app/
bundle install
Above commads were executed successfully.
Ruby version 2.2.1
Rails version 3.2.13
When I am trying to start my server, I am getting error like below
rails s
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'coffee-rails'. (Bundler::GemRequireError)
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/ela/Documents/first_app/config/application.rb:7:in `<top (required)>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/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>'
My Gem file ::
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Same error for 'uglifier' gem also so I removed those 2 gems. Then I am getting error in mysql adapter.
rails s
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
=> 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
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:314:in `block in replace_gem': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (can't activate mysql2 (~> 0.3.10), already activated mysql2-0.4.2. Make sure all dependencies are added to Gemfile.) (LoadError)
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:3:in `<top (required)>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/base.rb:720:in `<top (required)>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/ela/Documents/first_app/config/environment.rb:5:in `<top (required)>'
from /home/ela/Documents/first_app/config.ru:3:in `require'
from /home/ela/Documents/first_app/config.ru:3:in `block in <main>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/builder.rb:51:in `instance_eval'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/builder.rb:51:in `initialize'
from /home/ela/Documents/first_app/config.ru:in `new'
from /home/ela/Documents/first_app/config.ru:in `<main>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/builder.rb:40:in `eval'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/builder.rb:40:in `parse_file'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/server.rb:200:in `app'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/server.rb:304:in `wrapped_app'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/rack-1.4.7/lib/rack/server.rb:254:in `start'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/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>'
So I changed my gem mysql2 gem version to < 0.3
rake db:migrate --trace
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activesupport-3.2.13/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
============= WARNING FROM mysql2 =============
This version of mysql2 (0.2.24) isn't compatible with Rails 3.1 as the ActiveRecord adapter was pulled into Rails itself.
Please use the 0.3.x (or greater) releases if you plan on using it in Rails >= 3.1.x
============= END WARNING FROM mysql2 =============
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
rake aborted!
NoMethodError: undefined method `accept' for nil:NilClass
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `to_sql'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:38:in `select_values'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:587:in `get_all_versions'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:745:in `migrated'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:668:in `current_version'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:685:in `block in migrate'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:685:in `each'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:685:in `detect'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:685:in `migrate'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:570:in `up'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/migration.rb:551:in `migrate'
/home/ela/.rvm/gems/ruby-2.2.1#rails3.2.13/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/ela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/ela/.rvm/rubies/ruby-2.2.1/bin/rake:33:in `<main>'
Tasks: TOP => db:migrate
Someone please help me. Thanks in advance.
install nodejs
sudo apt-get install nodejs
then use
bundle install

rails server not starting on rails 3.1.2

I am using rails 3.2.1 with ruby 1.9.3 on ubuntu 13.10 with rbenv I hace everything good but when I try to start the server it gives an error anybody who know anything related to this please help. In a great need.
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- uuid (LoadError)
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/ahmed/Insoshi-Rails-3/config/initializers/custom_requires.rb:17:in `<top (required)>'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:652:in `block in load_config_initializer'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:651:in `load_config_initializer'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:615:in `each'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:615:in `block in <class:Engine>'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `each'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:203:in `each_strongly_connected_component_from'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:180:in `each'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `public_send'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `method_missing'
from /home/ahmed/Insoshi-Rails-3/config/environment.rb:5:in `<top (required)>'
from /home/ahmed/Insoshi-Rails-3/config.ru:3:in `require'
from /home/ahmed/Insoshi-Rails-3/config.ru:3:in `block in <main>'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
from /home/ahmed/Insoshi-Rails-3/config.ru:in `new'
from /home/ahmed/Insoshi-Rails-3/config.ru:in `<main>'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/ahmed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>
It is possible that all dependencies are not installed. If you have not used rvm to install ruby, you should try using it to install your ruby version.
rvm install 1.9.3
or
rvm reinstall 1.9.3
refer https://rvm.io/rvm/install for step by step instructions.

Rails MySQL Connection Problems

I am having an issue connecting to the mysql database using rails. I'm a newbie to rails but I have tried the guide here:
rails + MySQL on OSX: Library not loaded: libmysqlclient.18.dylib
and this still does not work. I believe I have two installations of mysql installed and this is confusing rails.
I have MAMP installed with it's own mysql and I also have the rails mysql2 gem installed. When I follow the steps from the link provided above, I think this is using the MAMP mysql install instead of the mysql2 install that I have with rails gems so it isn't recognizing it.
Is there any way I can consolidate the two mysql's into one? Or is it easier to modify rails so it can see the mysql2 gem?
Here is my error:
~/Sites/RoR3-Essentials/simple_cms ->rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://localhost:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in
`connect': Unknown database 'simple_cms_development' (Mysql2::Error)
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /Users/markmilly/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /Users/markmilly/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/markmilly/Sites/RoR3-Essentials/simple_cms/config/environment.rb:5:in `<top (required)>'
from /Users/markmilly/Sites/RoR3-Essentials/simple_cms/config.ru:3:in `require'
from /Users/markmilly/Sites/RoR3-Essentials/simple_cms/config.ru:3:in `block in <main>'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/markmilly/Sites/RoR3-Essentials/simple_cms/config.ru:in `new'
from /Users/markmilly/Sites/RoR3-Essentials/simple_cms/config.ru:in `<main>'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/markmilly/.rvm/gems/ruby-2.0.0-p0/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>'
#markmilly Answer to your last comment:
'rake db:create' creates the db that you specified in your config/database.yml file.
It will create the db for the current RAILS_ENV you're on. If the environment is not specified it will default to the development and test db's.
I see this answer is a bit late, but it might help someone else.

Rails server fails to boot with mysql2 - Gems it requires, exists

This is me trying to use MySql on rails for the first time. This happens with using sqlite3 as well except it points to me do 'gem install activerecord-sqlite3-adapter`,the tells me there is no such gem named it.
I am using the lastest Ruby 2.0.
I am using the lastest Rails 3.2.13
I have the mysql2 (0.3.11) gem
I also have the activerecord-mysql2-adapter (0.0.3)
Yet... it is giving me the following message:
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:214:in 'block in replace_gem': Please install the mysql2 adapter: 'gem install activerecord-mysql2-adapter' (mysql2 is not part of the bundle. Add it to Gemfile.) (LoadError)
The bundler ran when I executed rails new [project name]
If it was mysql2 gem's error, this command successfully installs mysql2 on 64 bit Windows systems:gem install mysql2 -v '0.3.11' -- '--with-mysql-lib="C:\MySQL\lib" --with-mysql-include="C:\MySQL\include"'
Gemfile generated is using gem 'mysql2'ok, normal as I have been told.
Database.yml is as follows:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: shop_development
pool: 5
username: charlie
password: *******
host: localhost
And I have manually created a database called [projectname]_development.
C:\Users\Charlie\Documents\RailsProject\demo_app>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
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integ
ration.rb:214:in `block in replace_gem': Please install the mysql2 adapter: `gem
install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it
to Gemfile.) (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/connection_adapters/mysql2_adapter.rb:3:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/dependencies.rb:251:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/connection_adapters/abstract/connection_specification.rb:50:in `resol
ve_hash_connection'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/connection_adapters/abstract/connection_specification.rb:41:in `resol
ve_string_connection'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/connection_adapters/abstract/connection_specification.rb:130:in `esta
blish_connection'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/lazy_load_hooks.rb:36:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/lazy_load_hooks.rb:36:in `execute_hook'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/lazy_load_hooks.rb:42:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/ac
tive_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/base.rb:720:in `<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/act
ive_record/railtie.rb:88:in `block in <class:Railtie>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/i
nitializable.rb:30:in `instance_exec'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/i
nitializable.rb:30:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/i
nitializable.rb:55:in `block in run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/i
nitializable.rb:54:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/i
nitializable.rb:54:in `run_initializers'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/a
pplication.rb:136:in `initialize!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/r
ailtie/configurable.rb:30:in `method_missing'
from C:/Users/Charlie/Documents/RailsProject/demo_app/config/environment
.rb:5:in `<top (required)>'
from C:/Users/Charlie/Documents/RailsProject/demo_app/config.ru:3:in `re
quire'
from C:/Users/Charlie/Documents/RailsProject/demo_app/config.ru:3:in `bl
ock in <main>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder
.rb:51:in `instance_eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder
.rb:51:in `initialize'
from C:/Users/Charlie/Documents/RailsProject/demo_app/config.ru:in `new'
from C:/Users/Charlie/Documents/RailsProject/demo_app/config.ru:in `<mai
n>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder
.rb:40:in `eval'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/builder
.rb:40:in `parse_file'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.
rb:200:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands/server.rb:46:in `app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.
rb:304:in `wrapped_app'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.4.5/lib/rack/server.
rb:254:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands/server.rb:70:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands.rb:55:in `block in <top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands.rb:50:in `tap'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/c
ommands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Check for following things
Does your Gemfile have the entry saying gem 'mysql2' ?
What happens when you run $ bundle update command? any errors
Can you try the following command to generate your app,
rails new demo_app -d mysql
What error you get when you try the above app?