Error Creating Rails Db Using Rake Db:Create

Error creating Rails DB using rake db:create

Thanks for all the help guys. Looks like the problem had to do with my install of the mysql gem under OSX.

@tim after I proceeded to the next step and got up and going I got an error on the console, so I did a bit of searching and found this helpful thread.

After I uninstalled my ruby gems gem uninstall mysql I installed the proper mysql gems using this command (from the thread):

export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

After executing this one I was able to successfully run rake db:create and proceed.

Thanks!!

Unable to create database with rake db:create command

Had this issue and never quite figured out why rails was doing this, but below should fix it.

  1. in terminal psql template1
  2. CREATE USER <username from config/database.yml if specified> with password '<password from config/database.yml if specified>';
  3. ALTER USER <username ...> WITH SUPERUSER;
  4. CREATE DATABASE chat_development WITH OWNER = '<username ...>';
  5. CREATE DATABASE chat_test WITH OWNER = '<username ...>';

you don't need step 2/3, or the WITH OWNER = '<username>'; unless you specify a user/password in config/database.yml.

Some common mistakes, pay close attention to where I have put single quotes, and don't forget the semi-colons!

Error in rake db:create in new rails project

I simply reinstalled ruby+rails and things were alright.

I deleted the ~/.rbenv folder and ran sudo apt-get purge ruby

Then installed ruby and rails using Official Page.

Importantly, once I created a new project I was prompted to install another gem to resolve some dependency gem install rdoc-data

ruby on rails error rake db:create

This will help you.

gem uninstall rake

gem install rake -v 0.8.7

If Still the problem exists, uninstall rake and install using

gem uninstall rake
gem install rake

for more info

Undefined method 'task' using Rake 0.9.0

Issue with rake db:create

Unless you're running Rails 4.2.5 or higher, you'll want to put the following in your Gemfile:

gem 'mysql2', '~> 0.3.10'

Source: mysql gem compatibility listing

Error when trying to create database with Rails, rake db:create

Are you allowed to use the root user without password? Is the mysqlserver listening on 127.0.0.1 or localhost?

not able to create database use rake db:create mysql

You should specify the host of database is located. In your database.yml you should add host: your_host:

development:
adapter: mysql2
encoding: utf8
reconnect: false
database: new-development
pool: 5
host: localhost # <your host>
username: root #< your_username >
password: password #< your_secret_password >


Related Topics



Leave a reply



Submit