1

コンソールに入ると:

git push heroku master

私は得る:

       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
       Would have removed sass-rails (3.2.6)
       Would have removed sass (3.2.5)
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Asset precompilation completed (13.99s)
-----> Rails plugin injection
       Injecting rails_log_stdout
       Injecting rails3_serve_static_assets
-----> Discovering process types
       Procfile declares types      -> (none)
       Default types for Ruby/Rails -> console, rake, web, worker

-----> Compiled slug size: 12.0MB
-----> Launching... done, v7
       http://chernobylmusic.herokuapp.com deployed to Heroku

ランニング:

heroku run rake db:migrate

結果は次のとおりです。

Running `rake db:migrate` attached to terminal... up, run.5186
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)

移行が適用されます。

Herokuの自分のページにアクセスすると、We're sorry, but something went wrong.

4

2 に答える 2

6

実行heroku logsしてエラーを確認します

于 2013-03-03T11:40:18.960 に答える
0

エラーログは言う

PG::Error: ERROR:  relation "events" does not exist

つまり、DB が作成されておらず、移行も実行されていません。Gemfile に pg gem があるかどうかを確認します。そうでない場合はgem 'pg'、Heroku が postgres で実行されるため、Gemfile のプロダクション ブロックに追加します。

それから

git push heroku master

次に

heroku run rake db:create

次に

heroku run rake db:migrate

それはうまくいくはずです。

于 2013-03-03T12:18:30.260 に答える