Could not load 'active_record/connection_adapters/sqlite3_adapter'

后端 未结 2 1494
挽巷
挽巷 2020-12-09 22:28

I\'m trying to install ROR on my notebook (Debian Wheezy 64 bit).

On first I had this issue (enter link description here ) solved by the first answer.

Now th

相关标签:
2条回答
  • 2020-12-09 23:07

    I've just struggled through this today. My error when trying to run rake db:create or rake db:migrate or running the server was slightly different:

    /Users/lisa/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': Could not load 'active_record/connection_adapters/sqlite_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)
    

    Note that it's trying to load sqlite_adapter, not sqlite3_adapter, despite the fact that my database.yml file is valid and does have 'sqlite3' in it. I did all kinds of things to my database.yml which caused me to realize that no matter what I tried (e.g. postgresql) rails was still trying to load sqlite. I finally looked around for something that was overriding database.yml and found it:

    $ env | grep sqlite
    
    DATABASE_URL=sqlite:////Users/lisa/dev/mango/devdb.sqlite
    

    This was set for playing around with django and was screwing up my rails environment. Ouch.

    0 讨论(0)
  • 2020-12-09 23:11

    Came across this error playing around in Sinatra today when running rake db:create_migration. My error was erroneously specifying a "sqlite:" database type in app.rb when it should have been "sqlite 3 :". Example:

    wrong:

    set :database, 'sqlite:name.db'
    

    correct:

    set :database, 'sqlite3:name.db'
    
    0 讨论(0)
提交回复
热议问题