0

(git push heroku master を使用して) アプリを heroku にデプロイしようとすると、エラーが発生し、sqlite3 -v '1.3.6' をインストールするように指示されます。そのgemを正常にインストールした後、herokuに再度デプロイしようとしましたが、それでも同じエラーが発生します!! しかし、私はすでにそれをインストールしました。そして今、自分の Rails プロジェクトをローカル (Rails サーバー) で実行することさえできません。これの原因は何ですか?

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
4

2 に答える 2

2

gemfile を次のようにします

      group :production do
         gem 'pg'
      end
      group :development, :test do
         gem 'sqlite3-ruby', :require => 'sqlite3'
      end
于 2012-07-17T16:35:43.263 に答える
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

于 2012-07-17T16:35:47.797 に答える