2012-05-23 35 views
0

我有一個需要多表繼承的rails應用程序,我使用CITIER gem,它本身需要rails_sql_views gem來生成表示對象的數據庫視圖。rails_sql_views在Heroku上禁止遷移

到目前爲止,這麼好。所有這些工作就像使用sqlite3在本地機器上的魅力一樣。但是,當我嘗試將應用程序部署到Heroku時,我無法執行數據庫遷移,也無法訪問Rail控制檯。

原因似乎是rails_sql_views gem試圖訪問PostgreSQLAdapter的一些聲稱不存在的方法。但是,當我檢查rails存儲庫的文件時,我可以在代碼中找到這些方法。這裏發生了什麼?

當我嘗試運行「的Heroku運行耙分貝:遷移」,我將結束與以下錯誤跟蹤:

Running rake db:migrate --trace attached to terminal... up, run.1 rake aborted! 
undefined method `tables' for class `ActiveRecord::ConnectionAdapters::PostgreSQLAdapter' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method_chain' 
/app/vendor/bundle/ruby/1.9.1/gems/rails_sql_views-0.8.0/lib/rails_sql_views/connection_adapters/postgresql_adapter.rb:5:in `included' 
/app/vendor/bundle/ruby/1.9.1/gems/rails_sql_views-0.8.0/lib/rails_sql_views/loader.rb:12:in `include' 
[....] 
+0

我能夠通過PostgreSQL在本地測試事情來將問題追溯回Gemfile。用「gem'rails_sql_views',:git =>'git://github.com/mremolt/rails_sql_views'替換」gem'rails_sql_views'「就可以做到這一點。 –

回答

0

這看起來與sqlite3的寶石和Postgres適配器之間的不兼容。你應該儘量保持發展儘可能接近生產。嘗試在本地安裝postgress https://devcenter.heroku.com/articles/local-postgresql並查看是否在本地出現相同的錯誤。如果是這樣,請考慮編寫一份詳細的錯誤報告並將其發送給Gem的作者,或者嘗試自己修復併發送拉取請求。