Hi,
execute[rake db:migrate] error:
'Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (mysql2 is not part of the bundle. Add it to Gemfile.)'
Detailed log is attached.
rake_execute_failed.txt
Seemed mysql2 did not get installed, as you can see in below:
Gemfile content
ubuntu@ip-172-31-31-20:/srv/posty_api$ pwd
/srv/posty_api
ubuntu@ip-172-31-31-20:/srv/posty_api$ cat Gemfile
source 'http://rubygems.org'
gem 'rack', '~> 1.5.2'
gem 'rake', '~> 10.3.2'
gem 'grape', '~> 0.7.0'
gem 'activerecord', '~> 3.2.22', require: 'active_record'
gem 'json'
gem 'grape-swagger'
gem 'rack-cors', require: 'rack/cors'
gem 'schema_plus', '~> 1.5.1'
group :test, :development do
gem 'rspec'
gem 'rack-test', require: 'rack/test'
gem 'shotgun'
gem 'racksh'
gem 'rubocop'
end
group :mysql, optional: true do
gem 'mysql2', '~> 0.3.16'
end
group :postgresql, optional: true do
gem 'pg', '~> 0.18.4'
gem 'activerecord-postgresql-adapter'
end
Check if mysql2 is installed==> NOT
ubuntu@ip-172-31-31-20:/srv/posty_api$ gem list | grep -i mysql
Tried to work around by manually installing mysql2..Still failed with same error
ubuntu@ip-172-31-31-20:/srv/posty_api$ sudo gem install mysql2
Fetching: mysql2-0.4.3.gem (100%)
Building native extensions. This could take a while...
Successfully installed mysql2-0.4.3
Parsing documentation for mysql2-0.4.3
unable to convert "\x9C" from ASCII-8BIT to UTF-8 for /usr/local/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0-static/mysql2-0.4.3/mysql2/mysql2.so, skipping
unable to convert "\x9C" from ASCII-8BIT to UTF-8 for lib/mysql2/mysql2.so, skipping
Installing ri documentation for mysql2-0.4.3
1 gem installed
ubuntu@ip-172-31-31-20:/srv/posty_api$ gem list | grep -i mysql
mysql2 (0.4.3)
To give it a go, I had to edit the Gemfile to directly include the mysql2 gem. You can see my edited Gemfile attached
Gemfile_edited.txt
Hi, execute[rake db:migrate] error: 'Please install the mysql2 adapter:
gem install activerecord-mysql2-adapter
(mysql2 is not part of the bundle. Add it to Gemfile.)' Detailed log is attached. rake_execute_failed.txtSeemed mysql2 did not get installed, as you can see in below: Gemfile content
Check if mysql2 is installed==> NOT
Tried to work around by manually installing mysql2..Still failed with same error
To give it a go, I had to edit the Gemfile to directly include the mysql2 gem. You can see my edited Gemfile attached Gemfile_edited.txt
With the second work-around, my boot-strap can go to next steps
My environment: RubyGem
Platform: