0

So my app was working fine until I restarted my computer and tried to run "rails server" to get my server up and running again. Instead, I get the following errors:

/Users/janedoe/.rvm/gems/ruby-2.3.0/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require': 

Could not load 'active_record/connection_adapters/mongodb_adapter'. 
Make sure that the adapter in config/database.yml is valid. 
If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 
'sqlite3' add the necessary adapter gem to the Gemfile. (LoadError)

Anyways, I've never used mongodb with my application in my entire life. (I use postgres) I don't know why it's asking me to use that adapter. The only thing I can think of is that I installed mongodb using homebrew for a separate project that has nothing to do with Rails. I don't know if maybe after installing it changed some of my things around for some weird, inexplicable reason.

Here is my database.yml file

development: 
  adapter: postgresql
  encoding: unicode
  pool: 5
  timeout: 5000

I'm not sure at all why it's trying to use mongodb_adapter. I dont have that specified anywhere, I haven't told it to ever use mongodb, I don't understand at all why this is happening....

janedoe
  • 907
  • 1
  • 13
  • 33
  • Try to do `bundle install` then `rake db:drop db:create db:migrate` . What is the output ? – zauzaj Aug 09 '17 at 11:45
  • Ok, I did a `bundle install` followed by a `rake db:migrate` and got the same error as above. for some reason it's ignoring my config file altogether? – janedoe Aug 09 '17 at 11:54
  • but did you run whole command what i posted above ? Not just `db:migrate` ? – zauzaj Aug 09 '17 at 12:07
  • I don't want to drop my entire database, there's way too much valuable data in there for me to just drop like that. – janedoe Aug 09 '17 at 12:13

1 Answers1

2

Please check this answer. It seems like there is a link in the bash_profile which affects the Rails database configurations.

Amr Afifi
  • 88
  • 10
  • thank you!! I think this is exactly what is wrong, I have a DATABASE_URL defined for another app in my environment variables. – janedoe Aug 09 '17 at 12:21