[英]Cloned GitHub Ruby repo, but not able to start it locally
Make sure you have Postgres installed and running 确保已安装并运行Postgres
Make sure your database is in place 确保数据库到位
rake db:create
rake db:migrate
The error is certainly that you've not got the pg
(PGSQL) gem installed. 错误肯定是您没有安装pg
(PGSQL) gem。
After Ruby 2.2, you can run Rails without the required gems; 在Ruby 2.2之后,您可以运行Rails而无需所需的gem。 you end up with a multitude of errors about missing files etc. This appears to be one of them, although we don't run pgsql
in dev, so I could be wrong. 您最终会遇到有关丢失文件等的许多错误。这似乎是其中之一,尽管我们没有在dev中运行pgsql
,所以我可能是错的。
-- -
Since you're using Windows, you'll have to download PGSQL and get the appropriate dependency files. 由于使用的是Windows,因此必须下载PGSQL并获取适当的依赖项文件。 Here's a tutorial : 这是一个教程 :
- Download PGSQL 下载PGSQL
- Run
gem install pg -- --with-pg-dir="c:/path/to/pg/sql"
运行gem install pg -- --with-pg-dir="c:/path/to/pg/sql"
- If this installs, you're good to try
rails s
again 如果安装了此程序,则最好再次尝试使用rails s
The most important thing to consider is that Windows uses different dependencies to Linux / Mac OS. 要考虑的最重要的事情是Windows使用与Linux / Mac OS不同的依赖关系。 I've not got the experience to tell you what those differences are; 我没有经验告诉您这些差异是什么; I can say that with "integration" gems ( mysql2
, rmagick
, nokogiri
, pg
), Ruby will require you download & reference the correct libraries in order to get the gem installed. 我可以说,对于“集成” gem( mysql2
, rmagick
, nokogiri
, pg
),Ruby将要求您下载并引用正确的库才能安装gem。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.