0

I am having difficulty pushing my most recent rails 3.2 app to heroku. I have been pushing to it previously with no problems, the most recent things that I have done since this last working commit was added a hstore column for postgres and a coupld of models. These all work perfectly on my and other computers.

On running

heroku run rake db:migrate I get the following output:

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

Note the error on the last line

Also on running heroku run db:setup I get this:

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

Again where there is an error on the last line.

then if I check heroku's logs I get the following (I presume because it hasnt run the migrations):

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]: 

Thanks in advance for your help

James
  • 97
  • 5

3 Answers3

0

Best guess is that you have outstanding migrations you have not run.

Try heroku run rake db:migrate. That should clear up the relations do not exist error.

For the rest, they are warnings. You can ignore them, but you are seeing that because probably the vendor/plugins folder in your project is non-empty, and when Rails 4 arrives, that would be deprecated.

Benjamin Tan Wei Hao
  • 9,621
  • 3
  • 30
  • 56
  • Hey, thanks for the help, but unfortunately I get the error above from running rake db:migrate and then it seems that the database is not migrated properly – James Sep 22 '12 at 04:06
  • 1
    My bad! Have you enable HStore in Heroku? https://devcenter.heroku.com/articles/is-hstore-available – Benjamin Tan Wei Hao Sep 22 '12 at 04:37
0

To fix this I simply went through my git from when it worked, and incrementally added the new features and was able to locate the problem

James
  • 97
  • 5
0

For future browsers, this question answered it for me. Just add this to the bottom of your Rakefile:

Rake::Task["db:structure:dump"].clear unless Rails.env.development?
Community
  • 1
  • 1
lobati
  • 9,284
  • 5
  • 40
  • 61