2012-07-17 169 views
0

當我想將我的應用程序部署到heroku(使用git push heroku master)時,它給了我一個錯誤,並告訴我安裝sqlite3 -v'1.3.6'。因此,成功安裝該寶石後,我試着再次部署到heroku,它仍然給我同樣的錯誤!不過,我已經安裝了它。現在我甚至無法在本地運行我的rails項目(rails服務器)。我可以知道這可能是什麼原因嗎?將應用程序部署到Heroku

這是我在database.yml文件內容:

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 
+0

你做了一個捆綁安裝?並可以發佈您的database.yml文件 – 2012-07-17 16:21:01

+0

yeap ..現在我得到了錯誤:「找不到RubyGem Bundler ......」這是非常奇怪的,因爲我一直在使用Rails一個月,沒有遇到任何問題! :(無論如何,我已經在qn – user1480797 2012-07-17 16:26:29

+0

中發佈了dataabase.yml文件,所以,heroku使用postgres,因此在您的gemfile中將sqlite gem放入組中:開發do – 2012-07-17 16:26:33

回答

2

Heroku的不SQLite3

工作打開你的Gemfile並更換線:

gem 'sqlite3' 

group :production do 
    gem 'pg' 
end 

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

我也建議你閱讀Heroku的說明:https://devcenter.heroku.com/articles/rails3

+0

這樣做的竅門!謝謝!雖然現在我又遇到了另外一個問題:「我們很抱歉,但出了問題」哈哈哈!這是另一個問題,但是非常感謝您解決這個問題!:D – user1480797 2012-07-17 18:03:58

2

讓你的Gemfile看起來像這樣

 group :production do 
     gem 'pg' 
     end 
     group :development, :test do 
     gem 'sqlite3-ruby', :require => 'sqlite3' 
     end 
相關問題