0

我正在尝试在 heroku 上部署我的应用程序。但是每次我尝试推送我的数据库时,我都会收到以下错误:

heroku db:push
Sending schema
Schema:        100% |==========================================| Time: 00:00:16
Sending indexes
refinery_page: 100% |==========================================| Time: 00:00:02
refinery_page: 100% |==========================================| Time: 00:00:01
refinery_page: 100% |==========================================| Time: 00:00:01
refinery_page: 100% |==========================================| Time: 00:00:04
refinery_role: 100% |==========================================| Time: 00:00:01
refinery_user: 100% |==========================================| Time: 00:00:01
refinery_user: 100% |==========================================| Time: 00:00:00
seo_meta:      100% |==========================================| Time: 00:00:01
schema_migrat: 100% |==========================================| Time: 00:00:00
Sending data
14 tables, 49 records
refinery_arti:   0% |     
Saving session to push_201305220223.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: LoadError: no such file to load -- sequel/adapters/
["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:in `require'", 
...

我使用 Rails 3.2.13、Ruby 1.9.3、refinerycms 和 mysql lite。我还尝试安装丢失的宝石......这是heroku的错吗?还是我只是愚蠢?:-)

我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

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

group :production do
  gem 'pg'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', '~> 2.0.0'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

# Refinery CMS
gem 'refinerycms', '~> 2.0.0', :git => 'git://github.com/refinery/refinerycms.git', :branch => '2-0-stable'

# Specify additional Refinery CMS Extensions here (all optional):
gem 'refinerycms-i18n', '~> 2.0.0'
#  gem 'refinerycms-blog', '~> 2.0.0'
#  gem 'refinerycms-inquiries', '~> 2.0.0'
#  gem 'refinerycms-search', '~> 2.0.0'
#  gem 'refinerycms-page-images', '~> 2.0.0'

gem 'refinerycms-articles', :path => 'vendor/extensions'

数据库.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

1

您必须在 Heroku 上使用 postgres,在 Gemfile 中执行以下操作:

group :production do
  gem 'pg'
end

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

然后提交更改并再次推送。

于 2013-05-22T09:53:57.770 回答
1

在您的 database.yml 文件中,与 PostgreSQL 数据库的连接为

production:
  adapter:PostgreSQL 
  database: production
  pool: 5
  timeout: 5000
于 2013-05-22T11:17:04.693 回答