【问题标题】:Heroku db pull error, it's looking for sqlite3 but I have postgres, how to change this?Heroku db pull 错误,它正在寻找 sqlite3 但我有 postgres,如何更改?
【发布时间】:2012-07-17 22:39:27
【问题描述】:

我安装了水龙头。 我收到以下错误。 这是我第一次从 Heroku 拉出这样的内容,所以我不确定确切的格式

$ heroku db:pull postgres://postgres:@localhost/prod_20120717

 !    Taps Load Error: cannot load such file -- sqlite3
 !    You may need to install or update the taps gem to use db commands.
 !    On most systems this will be:
 !    
 !    sudo gem install taps

我在 postgres 中创建了一个空的 prod_20120717 来接收数据,但问题似乎是 taps 正在寻找 sqlite3,而不是 postgres。

我的 postgres 用户是 postgres,没有密码。

我的 database.yml 文件只定义了 postgres 适配器。

这似乎是适配器名称问题。我还在postgres 所在的两个地方都尝试过postgresql

【问题讨论】:

    标签: ruby-on-rails ruby postgresql heroku taps


    【解决方案1】:

    只是一种预感,但我认为 sqlite 是水龙头的要求:

    https://github.com/ricardochimal/taps/blob/master/lib/taps/cli.rb 第 10 行:

    require 'sqlite3'
    

    我不认为这与您的实际应用程序有关,更多的是水龙头本身的工作原理,也许安装 gem 并从那里开始?

    【讨论】:

      【解决方案2】:

      答案是我实际上没有安装 sqlite3(我在 Mac 上,我的应用只使用 postgres),我必须安装它(sqlite3)。

      [sudo] gem install sqlite3
      

      我的 Gemfile 中不需要它,我只需要在我的机器上安装它。

      【讨论】:

        【解决方案3】:

        你有这样的 gemfile 设置吗?

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

        【讨论】:

          猜你喜欢
          • 2013-05-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-11-06
          • 1970-01-01
          • 2018-01-09
          相关资源
          最近更新 更多