애플리케이션을 시작하기 전에 사람들이 전자 메일에 가입 할 수있는 샘플 사전 가입 페이지를 작성하고 있습니다. 내가 입력하는 경우 :Heroku에 배포 (테이블이 존재하지 않음 오류)
heroku open
내 브라우저 내 로그를 확인한 후
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
에 다음과 같은 오류를 얻을, 나는이 이상한 오류를 발견 :
[36m2014-04-28T08:22:01.921791+00:00 app[web.1]:←[0m PG::UndefinedTable: ERROR:
relation "premails" does not exist
그게 무슨 뜻 이죠? 나는 다음과 같은 마이그레이션이 있습니다
class CreatePremails < ActiveRecord::Migration
def change
create_table :premails do |t|
t.text :email
t.timestamps
end
end
end
및 모델 :
class Premail < ActiveRecord::Base
end
내가 그에게 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
Heroku는 pg에서만 작동하므로 어쩌면 변경해야 할 필요가 있을까요? Windows8 64
에source 'https://rubygems.org'
gem 'pg'
gem 'bootstrap-sass', '~> 3.1.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :production do
gem 'rails_12factor', '0.0.2'
end
내가
감사 :
몇 가지 추가 정보는 여기 내 Gemfile입니다!
'heroku run rake db : migrate'을 실행 했습니까? –
그랬어! 젠장, 그렇게 간단 해! – user3408293
니스! 나는 문제가 어디에 서 있었는지를 설명하는 답을 썼다. –