【问题标题】:Could not find pg-0.17.1-x86-mingw32 in any of the sources在任何来源中都找不到 pg-0.17.1-x86-mingw32
【发布时间】:2014-12-25 12:01:00
【问题描述】:

我是 Rails 新手,正在学习一个教程,我刚刚完成了将应用程序推送到 Heroku 的过程。我被指示将这些 gem 添加到 gemfile 中:

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

group :development, :test do
     gem 'sqlite3'
end

之后我通过 Gitbash 运行 bundle install,但是当我重新启动本地服务器时出现错误:Could not find pg-0.17.1-x86-mingw32 in any sources

我正在运行 Windows 7 32 位机器,有什么办法可以解决这个问题吗?

【问题讨论】:

    标签: ruby-on-rails ruby


    【解决方案1】:

    您实际上不需要在开发机器上安装 pg gem,因为您使用 SQLite 作为开发和测试数据库。

    如果你使用bundle install --without production,你会避免这个问题。

    See this post for more info about using the --without production option

    【讨论】:

    • 完美运行,谢谢! (对于任何阅读的人,我使用了“bundle install --without production”,没有和生产之间的破折号不起作用。)
    • 我猜我什么时候想把它推回heroku,我可以像平常一样捆绑安装,推到git,然后在不运行本地服务器的情况下推到heroku?
    • 感谢您指出这个错字,我已修正。因为你的:production 组中有 pg gem,所以当你推送到 Heroku 时,你不应该做任何不同的事情。 Heroku 作为您的生产环境,应该负责为您安装 pg gem。
    猜你喜欢
    • 1970-01-01
    • 2014-09-19
    • 1970-01-01
    • 2014-11-30
    • 2013-03-26
    • 1970-01-01
    • 2017-07-14
    • 2018-01-31
    • 2012-03-12
    相关资源
    最近更新 更多