Trouble Getting the Rails Server Started

后端 未结 6 2006
逝去的感伤
逝去的感伤 2021-01-25 23:43

When I run \'rails server\' I get the following error:

Could not find gem \'sqlite3 (>= 0, runtime)\' in any of the gem sources listed in your Gemfile.
         


        
6条回答
  •  抹茶落季
    2021-01-26 00:23

    From your Rails directory:

    cd ..
    cd rails-root
    ruby -v
    gem list sqlite3
    bundle install
    gem list sqlite3
    bundle exec rails server
    

    What might be happening is you're bundling in a Rails app that has an .rvmrc file. I've seen cases where you bundle under a version of Ruby that doesn't match the .rvmrc file or some other mismatch so when you bundle sqlite3 it isn't under the same version of Ruby that rails is using when you run the app.

    Changing out of the directory and back into it, and running rails server prefixed with bundle exec are my two suggestions.

提交回复
热议问题