ruby on rails - Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (mysql2 is not part of the bundle. Add it to Gemfile.) (LoadError) -


i folllowing error when starting rails server using webrick on windows 7:

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 mysql2 adapter:gem install activerecord-mysql2-adapter` (mysql2 not part of bundle. add gemfile.) (loaderror)

i have made sure database.yml had adapter mysql2, gemfile lists mysql2. below database.yml file , gem file

    development:       adapter: mysql2       encoding: utf8       reconnect: false       database: elearn3_development       pool: 5       username: root       password: password       host: 127.0.0.1       port: 3306      test:       adapter: mysql2       encoding: utf8       reconnect: false       database: elearn3_test       pool: 5       username: root       password: passsword       host: 127.0.0.1       port: 3306      production:       adapter: mysql2       encoding: utf8       reconnect: false       database: elearn3_production       pool: 5       username: root       password: passsword       host: 127.0.0.1       port: 3306 

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 assets , not required # in production environments default. group :assets   gem 'sass-rails',   '~> 3.2.3'   gem 'coffee-rails', '~> 3.2.1'  # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', :platforms => :ruby  gem 'uglifier', '>= 1.0.3'     end  gem 'jquery-rails' 

i have tried various options posted in other threads having same issue, such adding gem 'mysql2' 'version no'. not resolve issue. have same issue while issuing sql-lite also.

your appreciated. in advance.

edit: when run bundle install, following in window. please observe mysql2 not part of using list. normal?

    using rake (10.0.4) using i18n (0.6.1) using multi_json (1.7.2) using activesupport (3.2.13) using builder (3.0.4) using activemodel (3.2.13) using erubis (2.7.0) using journey (1.0.4) using rack (1.4.5) using rack-cache (1.2) using rack-test (0.6.2) using hike (1.2.2) using tilt (1.4.0) using sprockets (2.2.2) using actionpack (3.2.13) using mime-types (1.23) using polyglot (0.3.3) using treetop (1.4.12) using mail (2.5.3) using actionmailer (3.2.13) using arel (3.0.2) using tzinfo (0.3.37) using activerecord (3.2.13) using activeresource (3.2.13) using coffee-script-source (1.6.2) using execjs (1.4.0) using coffee-script (2.2.0) using rack-ssl (1.3.3) using json (1.7.7) using rdoc (3.12.2) using thor (0.18.1) using railties (3.2.13) using coffee-rails (3.2.2) using jquery-rails (2.2.1) using bundler (1.3.5) using rails (3.2.13) using sass (3.2.8) using sass-rails (3.2.6) using uglifier (2.0.1) bundle complete! use `bundle show [gemname]` see bundled gem installed. 

edit after trying instructions http://www.mohanarun.com/how-to-install-mysql-adapter-ruby-gem-in-windows/, see bundle install picking mysql. but, following erros, when rails server.

/* many more errors before */

pport/core_ext/load_error.rb 369 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/name_error.rb 370 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/uri.rb 371 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_contr oller.rb 372 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_view/ railtie.rb 373 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/abstract_con troller/railties/routes_helpers.rb 374 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_contr oller/railties/paths.rb 375 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/action_contr oller/railtie.rb 376 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_rec ord/railtie.rb 377 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionmailer-3.2.13/lib/action_mai ler/version.rb 378 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/class/delegating_attributes.rb 379 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/module/reachable.rb 380 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/class/subclasses.rb 381 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/class.rb 382 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/core_ext/array/uniq_by.rb 383 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionmailer-3.2.13/lib/action_mai ler.rb 384 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionmailer-3.2.13/lib/action_mai ler/railtie.rb 385 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activeresource-3.2.13/lib/active_r esource/exceptions.rb 386 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activeresource-3.2.13/lib/active_r esource/version.rb 387 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activeresource-3.2.13/lib/active_r esource.rb 388 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activeresource-3.2.13/lib/active_r esource/railtie.rb 389 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/test_uni t/railtie.rb 390 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-3.2.13/lib/sprockets/ra iltie.rb 391 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/all.rb 392 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_su pport/string_inquirer.rb 393 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2/version.r b 394 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2/error.rb 395 c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2/result.rb

[note] may have encountered bug in ruby interpreter or extension libraries. bug reports welcome. details: bugreport

this application has requested runtime terminate in unusual way. please contact application's support team more information.

make sure add following gemfile:

gem 'mysql' gem 'mysql2', "~> 0.3.10" 

then run

bundle install 

question old may others.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -