2013-06-27 132 views
0

我真的很糾結Heroku的問題。我是一個新手,我已經嘗試了一些解決方案,他們似乎沒有幫助我。以下是錯誤我得到的寶石文件中使用heroku無法使用rails應用程序

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

這是進入我有sqlite的3

Gem files will remain installed in /tmp/build_2i8tok6rv3gyk/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7 for inspection. 
Results logged to /tmp/build_2i8tok6rv3gyk/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out 
    An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue. 
    Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling. 
! 
!  Failed to install gems via Bundler. 
!  
!  Detected sqlite3 gem which is not supported on Heroku. 
!  https://devcenter.heroku.com/articles/sqlite3 
! 
!  Push rejected, failed to compile Ruby/Rails app 

To [email protected]:glacial-wildwood-5205.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:glacial-wildwood-5205.git' 

回答

1

Heroku的不支持sqlite3,使用Postgresql代替。

group :development do 
    gem 'sqlite3' 
end 

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

這樣sqlite的將是你的本地數據庫,和Postgres將是測試和生產

+0

我該如何刪除sqlite3並添加postgresql? – Aravind

+0

已更新的答案。 – sunny1304

+0

'Gem文件將保留安裝在/home/aravind/.bundler/tmp/15662/gems/pg-0.12.2中進行檢查。 記錄到/home/aravind/.bundler/tmp/15662/gems/pg-0.12.2/ext/gem_make.out的結果 安裝pg(0.12.2)時發生錯誤,並且Bundler無法繼續。 確保'gem install pg -v'0.12.2''成功捆綁之前' 這是當我按照你說的去做的錯誤。請幫忙。 – Aravind

相關問題