bellycard / napa

A simple framework for building APIs with Grape
Other
329 stars 72 forks source link

rake aborted! Mysql2::Error: Access denied for user 'root'@'localhost' (using password: NO) #209

Closed jay3dec closed 9 years ago

jay3dec commented 9 years ago

I was able to create a new napa project and install the dependencies. Now when I do

rake db:reset

it throws the following error.

WARN: Unresolved specs during Gem::Specification.reset:
      rack (>= 0.4, >= 1.0, >= 1.0.0, >= 1.3.0)
      builder (>= 0)
      actionpack (>= 3.2)
      json (>= 1.7.7, ~> 1.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
rake aborted!
Gem::LoadError: You have already activated minitest 5.6.1, but your Gemfile requires minitest 4.7.5. Prepending `bundle exec` to your command may solve this.
/home/jay/NapaServ/app.rb:2:in `<top (required)>'
/home/jay/NapaServ/Rakefile:6:in `<top (required)>'
(See full trace by running task with --trace)

So, I prepend bundle exec to the command.

bundle exec rake db:reset

But this time throws the following error

rake aborted!
Mysql2::Error: Access denied for user 'root'@'localhost' (using password: NO)

Tasks: TOP => db:drop

The above error is quite weird because inside the project in the .env file the configurations are as follows

DATABASE_USER='rooty'
DATABASE_PASSWORD='root'
DATABASE_HOST=localhost
DATABASE_NAME=napaTest

As seen the username is rooty but the error shows root. So am I configuring the connections in the right file or is it something else

jasonhazel commented 9 years ago

I also ran into this issue, but it has been fixed. Looks like the gem hasn't been updated. To resolve, update your Gemfile.

Replace

gem 'napa'

with

gem 'napa', github: "bellycard/napa"

Then run bundle update

darbyfrey commented 9 years ago

Napa 0.5.0 was released to rubygems on 5/19, so this fix is now in the release as well - https://rubygems.org/gems/napa.