[ACCEPTED]-Rails / MySQL2: Error - Unknown database-macos
Have you created the database in MySQL? You 2 should be able to run rake db:create
and have Rails create 1 it for you.
I had the same error, please run the following 2 command on the Command Prompt:
rake db:create
to solve the 1 problem.
Look for the answers of these questions:
- Have you installed the mysql2 gem?
- Is it mentioned in your Gemfile?
- Did you run the command
rake db:create
?
0
Sometimes creating database with rake causes 9 issues.
You can also create the database 8 inside mysql
Make sure mysql is in the root 7 %PATH% in command prompt type echo %PATH% to 6 check.
If it isn't in your PATH. Then do 5 a quick google search on windows PATH to 4 get instructions
Open command prompt
type 3 mysql -u root -p
type your password that 2 you created for your root
To create database 1
create database simple_cms_development
done
was getting the same error but caused was 5 different
Mysql2::Error: Unknown database 'rdddd_development'
/Users/.rvm/gems/ruby-2.6.3/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in 4 connect'
/Users/commeasure/.rvm/gems/ruby-2.6.3/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in
initialize
faced this error due to the created 3 method dynamically, code is here
Role.all.map(&:name).map(&:parameterize).map(&:underscore).each do |name|
define_method("#{name.to_sym}?") do
role.name == name.upcase
end
end
How do 2 I fix this for the temporary purpose just 1 comment it out
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.