Trouble Getting the Rails Server Started

后端 未结 6 2101
逝去的感伤
逝去的感伤 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

    If you are running 10.4 or earlier you don't have sqlite 3 (the actual DB engine, not the gem) installed by default. You have 3 options (assuming upgrading your OS to 10.5 or 10.6 is not an option):

    1. Compile the source (not as bad as it sounds) http://www.sqlite.org/download.html
    2. Install MacPorts (why the port command was not found) http://www.macports.org/install.php
    3. Don't use sqlite. Instead use mysql or another DB of your choice.

    I recommend the latter if you are going to deploy using some DB other than sqlite, and deploying with sqlite generally isn't a good idea. I like to keep my development and production environments fairly uniform to help avoid gotchas and such.

    I hope this helps.

提交回复
热议问题