0

我第一次使用 SQLite3 从本地 Rails 环境部署到使用 postgresql 的 Heroku。我已经更新了我的 gemfile 以制定适当的开发/生产组条款。我确保将这些更改包含在主文件中。但是,当我运行 db:push 时,我反复收到以下错误

非常感谢您的帮助

prompt> C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custo
m_require.rb:36:in `require': LoadError: cannot load such file -- sqlite3 (Seque
l::AdapterNotFound)
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/r
ubygems/custom_require.rb:36:in `require'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/adapters/sqlite.rb:1:in `<top (required)>'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/r
ubygems/custom_require.rb:36:in `require'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/site_ruby/1.9.1/r
ubygems/custom_require.rb:36:in `require'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/core.rb:249:in `block in tsk_require'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/core.rb:72:in `block in check_requiring_thread'
        from <internal:prelude>:10:in `synchronize'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/core.rb:69:in `check_requiring_thread'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/core.rb:249:in `tsk_require'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/database/connecting.rb:25:in `adapter_class'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/database/connecting.rb:54:in `connect'
        from C:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/s
equel-3.20.0/lib/sequel/core.rb:119:in `connect'
        from C:/Program Files (x86)/Heroku/vendor/gems/taps-0.3.23/lib/taps/sche
ma.rb:17:in `dump_table'
        from C:/Program Files (x86)/Heroku/vendor/gems/taps-0.3.23/bin/schema:32
:in `<main>'
4

1 回答 1

1

要使heroku db:push命令正常工作,您需要在Ruby Heroku 捆绑包的版本中同时安装taps和gems。sqlite3

从上面的回溯中,似乎taps已安装,但缺少sqlite3适配器。

要安装它,请尝试以下操作:

  • Program Files启动提升的命令提示符(这样您就可以毫无问题地写入
  • cd "C:\Program Files (x86)\Heroku\ruby-1.9.2\bin"目录。
  • 调用gem install sqlite3 --no-ri --no-rdoc

那应该安装缺少的 gem 并允许heroku db:push使用您的 sqlite3 数据库。

希望有帮助。

于 2013-03-20T15:54:17.063 回答