ActionView::Template::Error (v1_retired): - ruby-on-rails

I have an old Rails Application which is working perfectly in development but once pushed to heroku, I get the error
ActionView::Template::Error (v1_retired):
Here's the link to the repo of the application.
Thanks for anybody's help in advance.
The error starts when I navigate to the posts path of the application.
Heroku logs show:
2017-10-15T06:15:40.681364+00:00 app[web.1]: Rendered posts/index.html.erb within layouts/application (242.1ms)
2017-10-15T06:15:40.684606+00:00 heroku[router]: at=info method=GET path="/posts" host=palmettostudios.herokuapp.com request_id=7cef0fd8-3df4-4eac-8236-499f871c4949 fwd="61.68.174.8" dyno=web.1 connect=1ms service=255ms status=500 bytes=1669 protocol=https
2017-10-15T06:15:40.682377+00:00 app[web.1]: Completed 500 Internal Server Error in 247ms (ActiveRecord: 8.3ms)
2017-10-15T06:15:40.683956+00:00 app[web.1]:
2017-10-15T06:15:40.683958+00:00 app[web.1]: ActionView::Template::Error (v1_retired):
2017-10-15T06:15:40.683959+00:00 app[web.1]: 27: <p><%= link_to 'Read Full Post', post_path(post), class:'pull-right btn btn-xs btn-link' %></p>
2017-10-15T06:15:40.683960+00:00 app[web.1]: 28: </div>
2017-10-15T06:15:40.683960+00:00 app[web.1]: 29: <div class='col-md-4 col-xs-12 post-image'>
2017-10-15T06:15:40.683961+00:00 app[web.1]: 30: <%= image_tag(post.image.url, class:'pull-right img img-responsive img-rounded') if post.image? %>
2017-10-15T06:15:40.683962+00:00 app[web.1]: 31: </div>
2017-10-15T06:15:40.683962+00:00 app[web.1]: 32: <% end %>
2017-10-15T06:15:40.683963+00:00 app[web.1]: 33: </div>
2017-10-15T06:15:40.683964+00:00 app[web.1]: app/views/posts/index.html.erb:30:in `block in _app_views_posts_index_html_erb___362288039534911980_70062267701880'
2017-10-15T06:15:40.683964+00:00 app[web.1]: app/views/posts/index.html.erb:21:in `_app_views_posts_index_html_erb___362288039534911980_70062267701880'
2017-10-15T06:15:40.683965+00:00 app[web.1]:

I just also ran into the same issue for an old Rails app of mine.
For me it was related to using the now deprecated gem paperclip-dropbox which relies on Dropbox's retired API v1.
Hope this information can be useful for everyone who comes here by searching for the non-descriptive error ActionView::Template::Error (v1_retired).

Related

Ruby on rails app works on local host but, not on heroku

I just learn ruby on rails. I created two database table: trainers and tokimons. Everything works fine on local host(including database), but something went wrong on heroku.
Here is the log:
2016-10-13T21:51:16.840425+00:00 heroku[router]: at=info method=GET path="/" host=a2-tokimon.herokuapp.com request_id=2f86b075-8d64-4616-984a-304df86d9768 fwd="142.58.35.51" dyno=web.1 connect=2ms service=11ms status=500 bytes=1669
2016-10-13T21:51:16.851541+00:00 app[web.1]: Started GET "/" for 142.58.35.51 at 2016-10-13 21:51:16 +0000
2016-10-13T21:51:16.854395+00:00 app[web.1]: Processing by WelcomeController#index as HTML
2016-10-13T21:51:16.858208+00:00 app[web.1]: Rendered welcome/index.erb within layouts/application (3.1ms)
2016-10-13T21:51:16.858340+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.3ms)
2016-10-13T21:51:16.859867+00:00 app[web.1]:
2016-10-13T21:51:16.859872+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "trainers" does not exist
2016-10-13T21:51:16.859873+00:00 app[web.1]: LINE 1: SELECT "trainers".* FROM "trainers"
2016-10-13T21:51:16.859874+00:00 app[web.1]: ^
2016-10-13T21:51:16.859874+00:00 app[web.1]: : SELECT "trainers".* FROM "trainers"):
2016-10-13T21:51:16.859875+00:00 app[web.1]: 51:
2016-10-13T21:51:16.859876+00:00 app[web.1]: 52:
2016-10-13T21:51:16.859877+00:00 app[web.1]: 53: <tbody>
2016-10-13T21:51:16.859877+00:00 app[web.1]: 54: <% #trainer.each do |trainer| %>
2016-10-13T21:51:16.859878+00:00 app[web.1]: 55: <tr class="<%= cycle('oddline', 'evenline') %>">
2016-10-13T21:51:16.859879+00:00 app[web.1]: 56: <td><%= trainer.pname %></td>
2016-10-13T21:51:16.859880+00:00 app[web.1]: 57: <td><%= trainer.level %></td>
2016-10-13T21:51:16.859881+00:00 app[web.1]: app/views/welcome/index.erb:54:in `_app_views_welcome_index_erb__3990380873615253162_69847032979680'
2016-10-13T21:51:16.859882+00:00 app[web.1]:
2016-10-13T21:51:16.859882+00:00 app[web.1]:
Here is a portion of trainers_controller.rb
class TrainersController < ApplicationController
before_action :set_trainer, only: [:show, :edit, :update, :destroy]
# GET /trainers
# GET /trainers.json
def index
#trainer = Trainer.all
end
Here is a portion of welcome_controller.rb
class WelcomeController < ApplicationController
# GET /welcome
def index
#trainer = Trainer.all
end
end
the line:
2016-10-13T21:51:16.859872+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "trainers" does not exist should be a hint that you have a postgres issue. Specifically that the tables are undefined.
Assuming you have heroku-cli installed, you'll need to run heroku run rake db:migrate in the console this will perform the migrations needed for Heroku.
Here is the documentation on how to get a Rails (4) app running on Heroku:
https://devcenter.heroku.com/articles/getting-started-with-rails4
And specifically here is the part about migrations:
https://devcenter.heroku.com/articles/getting-started-with-rails4#migrate-your-database
Heroku CLI documentation and installation instructions:
https://devcenter.heroku.com/articles/heroku-command-line
PG::UndefinedTable and PG::UndefinedColumn errors occur because you have not run the migrations against the production database.
You should make a habit of running heroku run rake:db:migrate after each deployment.

Heroku Database not being read properly

I am having trouble getting my Heroku app running. I want to import some data to my heroku database. I did this by running:
heroku pg:psql
\copy tablename FROM 'db/tableInfo.csv' DELIMITER ',' CSV;
then when I run:
select* from tablename
It prints out all the data I uploaded from the CSV, as desired.
However, when I go to my app and run "heroku open" my browser shows a page that says "We're sorry, but something went wrong." Then when I check the heroku logs, it says "PG::UndefinedTable: ERROR: relation "tablename" does not exist"
I am confused because when I go to the heroku site it says there are 3 rows (which I uploaded to tablename) and the "select * from tablename" after running heroku pg:psql displayed all the data that I wanted. Does anyone know why the relation isn't being recognized?
Thanks!
After running db:migrate I get this issue
EDIT: Here is the output from heroku logs (experimentInfo is the table name)
2016-03-15T05:33:16.813191+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:33:16.813192+00:00 app[web.1]: ^
2016-03-15T05:33:16.813193+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')
2016-03-15T05:33:16.813801+00:00 app[web.1]: Rendered main/experimentHome.html.erb within layouts/application (2.6ms)
2016-03-15T05:33:16.813872+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2016-03-15T05:33:16.816093+00:00 app[web.1]:
2016-03-15T05:33:16.816105+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:33:16.816123+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:33:16.816124+00:00 app[web.1]: ^
2016-03-15T05:33:16.816126+00:00 app[web.1]: 7: <%= #mexpMessage %>
2016-03-15T05:33:16.816125+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')):
2016-03-15T05:33:16.816127+00:00 app[web.1]: 8: <div class="alert alert-warning" style = "color:black" align = "left"><%= "To begin browsing the database, click on one of the experiments listed below. You can find information about each experiment listed in the blue boxes below each experiment link. To download the raw data for a given experiment, click the link next to the 'Click to download' field." %></div>
2016-03-15T05:33:16.816128+00:00 app[web.1]: 9: <h4> List of Experiments: </h4>
2016-03-15T05:33:16.816128+00:00 app[web.1]: 10: <% #experimentList.each do |e| %>
2016-03-15T05:33:16.816130+00:00 app[web.1]: 12: </a>
2016-03-15T05:33:16.816129+00:00 app[web.1]: 11: <%= link_to e.title, search_path(:selectexp => e.expId) %>
2016-03-15T05:33:16.816131+00:00 app[web.1]: 13: <div class="alert alert-info">
2016-03-15T05:33:16.816132+00:00 app[web.1]: app/views/main/experimentHome.html.erb:10:in `block in _app_views_main_experiment_ome_html_erb___1511755932124521423_70162519516940'
2016-03-15T05:33:16.816133+00:00 app[web.1]: app/views/main/experimentHome.html.erb:1:in `_app_views_main_experiment_ome_html_erb___1511755932124521423_70162519516940'
2016-03-15T05:33:16.816134+00:00 app[web.1]: app/controllers/main_controller.rb:6:in `experimentHome'
2016-03-15T05:33:16.816135+00:00 app[web.1]:
2016-03-15T05:33:16.816135+00:00 app[web.1]:
2016-03-15T05:33:16.805861+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-beach-44318.herokuapp.com request_id=9b7cfa64-a230-4077-b676-96f407bda79a fwd="128.12.253.5" dyno=web.1 connect=1ms service=34ms status=500 bytes=1458
2016-03-15T05:38:27.339628+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-beach-44318.herokuapp.com request_id=3a672911-5097-46ba-8920-7a307caeef2e fwd="128.12.253.5" dyno=web.1 connect=1ms service=32ms status=500 bytes=1458
2016-03-15T05:38:27.321501+00:00 app[web.1]: Started GET "/" for 128.12.253.5 at 2016-03-15 05:38:27 +0000
2016-03-15T05:38:27.343748+00:00 app[web.1]: Processing by MainController#experimentHome as HTML
2016-03-15T05:38:27.347286+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:38:27.347296+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:38:27.347298+00:00 app[web.1]: ^
2016-03-15T05:38:27.347299+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')
2016-03-15T05:38:27.348006+00:00 app[web.1]: Rendered main/experimentHome.html.erb within layouts/application (3.7ms)
2016-03-15T05:38:27.348212+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2016-03-15T05:38:27.350701+00:00 app[web.1]:
2016-03-15T05:38:27.350712+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:38:27.350712+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:38:27.350713+00:00 app[web.1]: ^
2016-03-15T05:38:27.350714+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')):
2016-03-15T05:38:27.350716+00:00 app[web.1]: 7: <%= #mexpMessage %>
2016-03-15T05:38:27.350718+00:00 app[web.1]: 8: <div class="alert alert-warning" style = "color:black" align = "left"><%= "To begin browsing the database, click on one of the experiments listed below. You can find information about each experiment listed in the blue boxes below each experiment link. To download the raw data for a given experiment, click the link next to the 'Click to download' field." %></div>
2016-03-15T05:38:27.350719+00:00 app[web.1]: 10: <% #experimentList.each do |e| %>
2016-03-15T05:38:27.350718+00:00 app[web.1]: 9: <h4> List of Experiments: </h4>
2016-03-15T05:38:27.350720+00:00 app[web.1]: 11: <%= link_to e.title, search_path(:selectexp => e.expId) %>
2016-03-15T05:38:27.350720+00:00 app[web.1]: 12: </a>
2016-03-15T05:38:27.350721+00:00 app[web.1]: 13: <div class="alert alert-info">
2016-03-15T05:38:27.350722+00:00 app[web.1]: app/views/main/experimentHome.html.erb:10:in `block in _app_views_main_experiment_ome_html_erb___1511755932124521423_70162519291600'
2016-03-15T05:38:27.350724+00:00 app[web.1]: app/views/main/experimentHome.html.erb:1:in `_app_views_main_experiment_ome_html_erb___1511755932124521423_70162519291600'
2016-03-15T05:38:27.350725+00:00 app[web.1]: app/controllers/main_controller.rb:6:in `experimentHome'
2016-03-15T05:38:27.350725+00:00 app[web.1]:
2016-03-15T05:38:27.350726+00:00 app[web.1]:
2016-03-15T05:49:37.158759+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-beach-44318.herokuapp.com request_id=fe636ea4-c661-4ca3-b5b9-3b8e809f9a42 fwd="128.12.253.5" dyno=web.1 connect=2ms service=14ms status=500 bytes=1458
2016-03-15T05:49:37.157464+00:00 app[web.1]: Started GET "/" for 128.12.253.5 at 2016-03-15 05:49:37 +0000
2016-03-15T05:49:37.158827+00:00 app[web.1]: Processing by MainController#experimentHome as HTML
2016-03-15T05:49:37.162467+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:49:37.162475+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:49:37.162477+00:00 app[web.1]: ^
2016-03-15T05:49:37.162478+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')
2016-03-15T05:49:37.163383+00:00 app[web.1]: Rendered main/experimentHome.html.erb within layouts/application (3.6ms)
2016-03-15T05:49:37.163562+00:00 app[web.1]: Completed 500 Internal Server Error in 5ms
2016-03-15T05:49:37.166125+00:00 app[web.1]:
2016-03-15T05:49:37.166138+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:49:37.166139+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:49:37.166139+00:00 app[web.1]: ^
2016-03-15T05:49:37.166140+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')):
2016-03-15T05:49:37.166141+00:00 app[web.1]: 7: <%= #mexpMessage %>
2016-03-15T05:49:37.166144+00:00 app[web.1]: 9: <h4> List of Experiments: </h4>
2016-03-15T05:49:37.166160+00:00 app[web.1]: 10: <% #experimentList.each do |e| %>
2016-03-15T05:49:37.166161+00:00 app[web.1]: 11: <%= link_to e.title, search_path(:selectexp => e.expId) %>
2016-03-15T05:49:37.166161+00:00 app[web.1]: 12: </a>
2016-03-15T05:49:37.166144+00:00 app[web.1]: 8: <div class="alert alert-warning" style = "color:black" align = "left"><%= "To begin browsing the database, click on one of the experiments listed below. You can find information about each experiment listed in the blue boxes below each experiment link. To download the raw data for a given experiment, click the link next to the 'Click to download' field." %></div>
2016-03-15T05:49:37.166162+00:00 app[web.1]: 13: <div class="alert alert-info">
2016-03-15T05:49:37.166163+00:00 app[web.1]: app/views/main/experimentHome.html.erb:10:in `block in _app_views_main_experiment_ome_html_erb___1511755932124521423_70162519291600'
2016-03-15T05:49:37.166164+00:00 app[web.1]: app/views/main/experimentHome.html.erb:1:in `_app_views_main_experiment_ome_html_erb___1511755932124521423_70162519291600'
2016-03-15T05:49:37.166165+00:00 app[web.1]: app/controllers/main_controller.rb:6:in `experimentHome'
2016-03-15T05:49:37.166166+00:00 app[web.1]:
2016-03-15T05:49:37.166166+00:00 app[web.1]:
2016-03-15T05:51:40.692387+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-beach-44318.herokuapp.com request_id=4867e943-7dab-40d9-8944-a030c8977e39 fwd="128.12.253.5" dyno=web.1 connect=0ms service=12ms status=500 bytes=1458
2016-03-15T05:51:40.699721+00:00 app[web.1]: Started GET "/" for 128.12.253.5 at 2016-03-15 05:51:40 +0000
2016-03-15T05:51:40.700884+00:00 app[web.1]: Processing by MainController#experimentHome as HTML
2016-03-15T05:51:40.706934+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:51:40.706951+00:00 app[web.1]: ^
2016-03-15T05:51:40.706942+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:51:40.707848+00:00 app[web.1]: Completed 500 Internal Server Error in 7ms
2016-03-15T05:51:40.706953+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')
2016-03-15T05:51:40.710357+00:00 app[web.1]:
2016-03-15T05:51:40.707677+00:00 app[web.1]: Rendered main/experimentHome.html.erb within layouts/application (6.0ms)
2016-03-15T05:51:40.710386+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "experimentInfo" does not exist
2016-03-15T05:51:40.710387+00:00 app[web.1]: LINE 1: SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expI...
2016-03-15T05:51:40.710388+00:00 app[web.1]: ^
2016-03-15T05:51:40.710388+00:00 app[web.1]: : SELECT "experimentInfo".* FROM "experimentInfo" WHERE (expId != 'expId')):
2016-03-15T05:51:40.710389+00:00 app[web.1]: 7: <%= #mexpMessage %>
2016-03-15T05:51:40.710391+00:00 app[web.1]: 8: <div class="alert alert-warning" style = "color:black" align = "left"><%= "To begin browsing the database, click on one of the experiments listed below. You can find information about each experiment listed in the blue boxes below each experiment link. To download the raw data for a given experiment, click the link next to the 'Click to download' field." %></div>
2016-03-15T05:51:40.710392+00:00 app[web.1]: 9: <h4> List of Experiments: </h4>
2016-03-15T05:51:40.710393+00:00 app[web.1]: 10: <% #experimentList.each do |e| %>
2016-03-15T05:51:40.710393+00:00 app[web.1]: 11: <%= link_to e.title, search_path(:selectexp => e.expId) %>
2016-03-15T05:51:40.710394+00:00 app[web.1]: 12: </a>
2016-03-15T05:51:40.710395+00:00 app[web.1]: 13: <div class="alert alert-info">
2016-03-15T05:51:40.710396+00:00 app[web.1]: app/views/main/experimentHome.html.erb:10:in `block in _app_views_main_experiment_ome_html_erb___1511755932124521423_70162519516940'
2016-03-15T05:51:40.710397+00:00 app[web.1]: app/views/main/experimentHome.html.erb:1:in `_app_views_main_experiment_ome_html_erb___1511755932124521423_70162519516940'
2016-03-15T05:51:40.710399+00:00 app[web.1]:
2016-03-15T05:51:40.710398+00:00 app[web.1]: app/controllers/main_controller.rb:6:in `experimentHome'
2016-03-15T05:51:40.710400+00:00 app[web.1]:

Rails application heroku Error

Rails 4.1.5
ruby 2.1.2p95
MongoDB - 2.4.13
it works file in local system but when on deplying heroku it gives went wrong
mongodb.yml
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
options:
consistency: :strong
max_retries_on_connection_failure: 20
persist_in_safe_mode: true
skip_version_check: true
here is heroku log
> 2015-12-27T11:48:46.350015+00:00 app[web.1]: Processing by UsersController#index as HTML
2015-12-27T11:48:48.870124+00:00 heroku[router]: at=info method=GET path="/users" host=lit-fjord-5279.herokuapp.com request_id=02419aa9-43c9-4446-b8e9-8a9f7a441b40 fwd="122.172.61.174" dyno=web.1 connect=13ms service=9ms status=500 bytes=1754
2015-12-27T11:48:48.870017+00:00 app[web.1]: Started GET "/users" for 122.172.61.174 at 2015-12-27 11:48:48 +0000
2015-12-27T11:48:48.873238+00:00 app[web.1]: Rendered users/index.html.erb within layouts/application (0.9ms)
2015-12-27T11:48:48.873359+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms
2015-12-27T11:48:48.874438+00:00 app[web.1]:
2015-12-27T11:48:48.874441+00:00 app[web.1]: ActionView::Template::Error (
2015-12-27T11:48:48.874442+00:00 app[web.1]: message:
2015-12-27T11:48:48.874443+00:00 app[web.1]: No configuration could be found for a client named 'default'.
2015-12-27T11:48:48.874444+00:00 app[web.1]: summary:
2015-12-27T11:48:48.874445+00:00 app[web.1]: When attempting to create the new client, Mongoid could not find a client configuration for the name: 'default'. This is necessary in order to know the host, port, and options needed to connect.
2015-12-27T11:48:48.874446+00:00 app[web.1]: resolution:
2015-12-27T11:48:48.874446+00:00 app[web.1]: Double check your mongoid.yml to make sure under the clients key that a configuration exists for 'default'. If you have set the configuration programatically, ensure that 'default' exists in the configuration hash.):
2015-12-27T11:48:48.874447+00:00 app[web.1]: 10: </thead>
2015-12-27T11:48:48.874450+00:00 app[web.1]: 14: <tr>
2015-12-27T11:48:48.874450+00:00 app[web.1]: 15: <td><%= user.name %></td>
2015-12-27T11:48:48.874451+00:00 app[web.1]: 16: <td><%= user.email %></td>
2015-12-27T11:48:48.874448+00:00 app[web.1]: 11:
2015-12-27T11:48:48.874448+00:00 app[web.1]: 12: <tbody>
2015-12-27T11:48:48.874449+00:00 app[web.1]: 13: <% #users.each do |user| %>
2015-12-27T11:48:48.874452+00:00 app[web.1]: app/views/users/index.html.erb:13:in `_app_views_users_index_html_erb__1900358265610175239_69916668256060'
2015-12-27T11:48:48.874453+00:00 app[web.1]:
2015-12-27T11:48:48.874453+00:00 app[web.1]:
Error:
Double check your mongoid.yml to make sure under the clients key that a configuration exists for 'default'
File name:
mongodb.yml
One of these things is not like the other. Try to rename the file to mongoid.yml
Mongoid Tutorial, configuration

we're sorry, but something went wrong on heroku when a user tries signing up [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I can't correctly pinpoint what exactly is causing the issue
This is a new website I just pushed to heroku, ran heroku rake db:migrate, and heroku restart
It works just fine locally but this happens in production
Here's the relevant portion of heroku logs
2013-05-03T23:16:27.189569+00:00 app[web.1]:
2013-05-03T23:16:27.189569+00:00 app[web.1]: Started GET "/signup" for xx.xx.xx.
xxx at 2013-05-03 23:16:27 +0000
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered shared/_error_messages.h
tml.erb (0.4ms)
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered layouts/_shim.html.erb (
0.0ms)
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered layouts/_header.html.erb
(2.9ms)
2013-05-03T23:16:27.253381+00:00 app[web.1]: Processing by UsersController#new a
s HTML
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered users/new.html.erb withi
n layouts/application (43.8ms)
2013-05-03T23:16:27.253381+00:00 app[web.1]: Completed 200 OK in 60ms (Views: 48
.4ms | ActiveRecord: 1.6ms | Solr: 0.0ms)
2013-05-03T23:16:27.922135+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect
=1ms service=4ms status=304 bytes=0
2013-05-03T23:16:27.268937+00:00 heroku[router]: at=info method=GET path=/signup
host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=6ms
service=81ms status=304 bytes=0
2013-05-03T23:16:47.934099+00:00 app[web.1]:
2013-05-03T23:16:47.934099+00:00 app[web.1]:
2013-05-03T23:16:47.934099+00:00 app[web.1]: Started POST "/users" for xx.xx.xx.
xxx at 2013-05-03 23:16:47 +0000
2013-05-03T23:16:48.248989+00:00 app[web.1]: Redirected to http://sleepy-river-xxxx.herokuapp.com/home
2013-05-03T23:16:48.248989+00:00 app[web.1]: Parameters: {"utf8"=>"???", "auth
enticity_token"=>"m+NCbnqHJk81yWgyY+Y709mQZ0N04MpW8MLGLXjbleA=", "user"=>{"name"
=>"testuser", "email"=>"testuser#email.com", "password"=>"[FILTERED]", "passwo
rd_confirmation"=>"[FILTERED]"}, "commit"=>"Create my account"}
2013-05-03T23:16:48.248989+00:00 app[web.1]: Completed 302 Found in 311ms (Activ
eRecord: 70.6ms)
2013-05-03T23:16:48.248989+00:00 app[web.1]: Processing by UsersController#creat
e as HTML
2013-05-03T23:16:48.435265+00:00 app[web.1]:
2013-05-03T23:16:48.435265+00:00 app[web.1]:
2013-05-03T23:16:48.435265+00:00 app[web.1]: Started GET "/home" for 75.82.32.16
4 at 2013-05-03 23:16:48 +0000
2013-05-03T23:16:48.649331+00:00 app[web.1]: FROM pg_attribute a L
EFT JOIN pg_attrdef d
2013-05-03T23:16:48.649331+00:00 app[web.1]: WHERE a.attrelid = '"h
ashtags"'::regclass
2013-05-03T23:16:48.649331+00:00 app[web.1]: LINE 4: WHERE a.attrel
id = '"hashtags"'::regclass
2013-05-03T23:16:48.649331+00:00 app[web.1]: ON a.attrelid = d.a
drelid AND a.attnum = d.adnum
2013-05-03T23:16:48.649617+00:00 app[web.1]: 23: <%= link_to "#"+h.hashtag
s, "#" %><br>
2013-05-03T23:16:48.649617+00:00 app[web.1]: 25:
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered shared/_user_info.html.e
rb (4.4ms)
2013-05-03T23:16:48.649331+00:00 app[web.1]: ActionView::Template::Error (PGErro
r: ERROR: relation "hashtags" does not exist
2013-05-03T23:16:48.649617+00:00 app[web.1]: 22: <% #htags.each do |h| %>
2013-05-03T23:16:48.649617+00:00 app[web.1]:
2013-05-03T23:16:48.649845+00:00 app[web.1]: Processing by StaticPagesController
#home as HTML
2013-05-03T23:16:48.649331+00:00 app[web.1]:
2013-05-03T23:16:48.649331+00:00 app[web.1]:
^
2013-05-03T23:16:48.649331+00:00 app[web.1]: : SELECT a.attname, for
mat_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2013-05-03T23:16:48.649617+00:00 app[web.1]: app/views/static_pages/home.html.
erb:22:in `_app_views_static_pages_home_html_erb___3097102804728997358_70437520'
2013-05-03T23:16:48.649845+00:00 app[web.1]:
2013-05-03T23:16:48.649331+00:00 app[web.1]: AND a.attnum > 0 AND
NOT a.attisdropped
2013-05-03T23:16:48.649331+00:00 app[web.1]: ORDER BY a.attnum
2013-05-03T23:16:48.649617+00:00 app[web.1]: 19: <div class="box">
2013-05-03T23:16:48.649617+00:00 app[web.1]: 24: <% end %>
2013-05-03T23:16:48.649617+00:00 app[web.1]: ):
2013-05-03T23:16:48.649617+00:00 app[web.1]: 20: Tagged Posts
2013-05-03T23:16:48.649617+00:00 app[web.1]: 21: <br>
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered shared/_stats.html.erb (
38.9ms)
2013-05-03T23:16:48.649845+00:00 app[web.1]: Completed 500 Internal Server Error
in 209ms
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered static_pages/home.html.e
rb within layouts/application (156.1ms)
2013-05-03T23:16:48.654562+00:00 heroku[router]: at=info method=GET path=/home h
ost=sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=1ms se
rvice=219ms status=500 bytes=643
2013-05-03T23:16:48.253053+00:00 heroku[router]: at=info method=POST path=/users
host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=3ms
service=395ms status=302 bytes=109
Something is wrong with the template that is loaded after a user signs up. Try it locally, I bet you'll find the answer you need.
Added hint:
Look at the line Relation HashTags does not exist. That holds the key to your problem.
I bet if you run
heroku run rake db:setup
and
heroku run rake db:migrate
Your problem will be solved

ActionView::Template::Error ( isn't precompiled):

In production (Heroku), I'm getting the following error:
Started GET "/articles/1" for 50.134.181.231 at 2012-06-17 00:37:35 +0000
2012-06-17T00:37:35+00:00 app[web.1]: ActionView::Template::Error ( isn't precompiled):
2012-06-17T00:37:35+00:00 heroku[router]: GET wandr.com/articles/1 dyno=web.1 queue=0 wait=0ms service=497ms status=500 bytes=728
2012-06-17T00:37:35+00:00 app[web.1]:
2012-06-17T00:37:35+00:00 app[web.1]: 74: = image_tag #article.featured_photo_url(:sm).to_s
2012-06-17T00:37:35+00:00 app[web.1]: 75:
2012-06-17T00:37:35+00:00 app[web.1]: 77: = image_tag #article.background_photo_url(:md).to_s
2012-06-17T00:37:35+00:00 app[web.1]: 76: %p
2012-06-17T00:37:35+00:00 app[web.1]: 78: %p
2012-06-17T00:37:35+00:00 app[web.1]: 79: = image_tag #article.cover_photo_url(:md).to_s
2012-06-17T00:37:35+00:00 app[web.1]: 80:
2012-06-17T00:37:35+00:00 app[web.1]: app/views/articles/show.html.haml:77:in `_app_views_articles_show_html_haml__1847247375488199378_48105500'
2012-06-17T00:37:35+00:00 app[web.1]:
2012-06-17T00:37:35+00:00 app[web.1]: app/controllers/articles_controller.rb:21:in `show'
2012-06-17T00:37:35+00:00 app[web.1]:
2012-06-17T00:37:35+00:00 app[web.1]: Processing by ArticlesController#show as HTML
2012-06-17T00:37:35+00:00 app[web.1]: Rendered articles/show.html.haml within layouts/admin (420.5ms)
2012-06-17T00:37:35+00:00 app[web.1]: Parameters: {"id"=>"1"}
2012-06-17T00:37:35+00:00 app[web.1]: Completed 500 Internal Server Error in 486ms
I'm running Rails 3.2.6, including actionpack 3.2.6 which I thought had this fix for this issue: https://github.com/rails/rails/commit/6bb86e1f3f7f9e11ee1c056d8742125173ecbce1
I also tried this: "ActionView::Template::Error ( isn't precompiled)" raised on "image_tag nil"
Basically, as long as one of the images on this page don't exist, it's throwing this error. If I upload the images, it works fine. Any ideas?
Thanks,
--Mark
I assume you're using something like CarrierWave to handle file uploads? You can specify a default image handler in your uploader class:
https://github.com/jnicklas/carrierwave#providing-a-default-url
class MyUploader < CarrierWave::Uploader::Base
def default_url
"/images/fallback/" + [version_name, "default.png"].compact.join('_')
end
end
This will output the default image rather than trying to access a non-existent file called "" in the asset pipeline.

Resources