最新の Rails 3.2 アプリを heroku にプッシュするのに苦労しています。私は以前に問題なくプッシュしてきました。この最後の作業コミット以降に行った最新のことは、postgres の hstore 列とモデルの結合が追加されたことです。これらはすべて、私のコンピューターや他のコンピューターで完全に機能します。
実行中
heroku run rake db:migrate 次の出力が得られます。
james@James-PC:~/tendersave$ heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.1
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)
/app/vendor/bundle/ruby/1.9.1/bin/rake: No such file or directory - pg_dump -i -s -x -O -f /app/db/structure.sql d36q1tfb51f169
最後の行のエラーに注意してください
また、heroku run db:setup を実行すると、次のようになります。
james@James-PC:~/tendersave$ heroku run rake db:setup
Running `rake db:setup` attached to terminal... up, run.1
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)
d36q1tfb51f169 already exists
sh: psql: not found
ここでも最後の行にエラーがあります。
次に、heroku のログを確認すると、次のようになります (移行が実行されていないためと推測されます)。
2012-09-22T02:24:06+00:00 app[web.1]: Started GET "/" for 203.173.199.11 at 2012-09-22 02:24:06 +0000
2012-09-22T02:24:06+00:00 app[web.1]: Processing by ProposalsController#index as HTML
2012-09-22T02:24:06+00:00 app[web.1]: Rendered proposals/index.html.erb within layouts/application (65.2ms)
2012-09-22T02:24:06+00:00 app[web.1]: Completed 500 Internal Server Error in 295ms
2012-09-22T02:24:06+00:00 app[web.1]:
2012-09-22T02:24:06+00:00 app[web.1]: ActionView::Template::Error (PG::Error: ERROR: relation "proposals" does not exist
2012-09-22T02:24:06+00:00 app[web.1]: LINE 4: WHERE a.attrelid = '"proposals"'::regclass
2012-09-22T02:24:06+00:00 app[web.1]: ^
2012-09-22T02:24:06+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-09-22T02:24:06+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-09-22T02:24:06+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-09-22T02:24:06+00:00 app[web.1]: WHERE a.attrelid = '"proposals"'::regclass
2012-09-22T02:24:06+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2012-09-22T02:24:06+00:00 app[web.1]: ORDER BY a.attnum
2012-09-22T02:24:06+00:00 app[web.1]: ):
2012-09-22T02:24:06+00:00 app[web.1]: 16: <th></th>
2012-09-22T02:24:06+00:00 app[web.1]: 17: </tr>
2012-09-22T02:24:06+00:00 app[web.1]: 18:
2012-09-22T02:24:06+00:00 app[web.1]: 19: <% @proposals.each do |proposal| %>
2012-09-22T02:24:06+00:00 app[web.1]: 20: <tr>
2012-09-22T02:24:06+00:00 app[web.1]: 21: <td><%#= proposal.active %></td>
2012-09-22T02:24:06+00:00 app[web.1]: 22: <td><%= proposal.type %></td>
2012-09-22T02:24:06+00:00 app[web.1]: app/controllers/proposals_controller.rb:14:in `index'
2012-09-22T02:24:06+00:00 app[web.1]:
2012-09-22T02:24:06+00:00 app[web.1]: app/views/proposals/index.html.erb:19:in `_app_views_proposals_index_html_erb__922970733135020301_38000420'
2012-09-22T02:24:06+00:00 app[web.1]:
よろしくお願いいたします。