I have a Rails app and I just installed gem 'mobiscroll-rails'.
I got it working in development on my iMac. But, when I run it on Heroku, I get:
ActionController::RoutingError (No route matches [GET] "/apple-touch-icon-precomposed.png"):
app[web.1]: cache: [GET /apple-touch-icon-precomposed.png] miss
heroku[router]: at=info method=GET path=/apple-touch-icon-precomposed.png host=www.requestsys.com fwd=70.34.1.156 dyno=web.1 queue=0 wait=0ms connect=5ms service=8ms status=404 bytes=728
heroku[nginx]: 70.34.1.156 - - [20/Jan/2013:23:58:46 +0000] "GET /apple-touch-icon-precomposed.png HTTP/1.1" 404 728 "-" "MobileSafari/8536.25 CFNetwork/609 Darwin/13.0.0" www.requestsys.com
app[web.1]: Started GET "/apple-touch-icon.png" for 70.34.1.156 at 2013-01-20 16:58:47 -0700
ActionController::RoutingError (No route matches [GET] "/apple-touch-icon.png"):
cache: [GET /apple-touch-icon.png] miss
"GET /apple-touch-icon.png HTTP/1.1" 404 728 "-" "MobileSafari/8536.25 CFNetwork/609 Darwin/13.0.0" www.requestsys.com
at=info method=GET path=/apple-touch-icon.png host=www.requestsys.com fwd=70.34.1.156 dyno=web.1 queue=0 wait=0ms connect=3ms service=7ms status=404 bytes=728
My application.html.erb has:
<!-- Le fav and touch icons -->
<link href="images/favicon.ico" rel="shortcut icon">
<link href="images/apple-touch-icon.png" rel="apple-touch-icon">
<link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
<link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
Thanks!
UPDATE -- now I'm getting this:
ActionView::Template::Error (Invalid CSS after ".ios td:": expected pseudoclass or pseudoelement, was " first-child .d..."
(in /app/app/assets/stylesheets/application.css)):
17: }
18:
19:
20: <%= stylesheet_link_tag "application", :media => "all" %>
app/views/layouts/application.html.erb:20:in `_app_views_layouts_application_html_erb__4520300412125467599_68152740'
Looks like some invalid CSS somewhere in the mobiscroll-rails gem. I got it locally when I bundled:
gem 'mobiscroll-rails'
and did rake assets:precompile, which is what's happening on Heroku during asset compilation. I loaded the version from the git repo and was able to precompile just fine:
gem 'mobiscroll-rails', :git => 'https://github.com/crushlovely/mobiscroll-rails.git'
EDIT: Alternatively, you can try this gem that just came out a couple of days ago:
https://github.com/Dinuz/mobiscroll-rails.git
Related
I have a rails4 app deployed on heroku and using cloudfront as CDN.
Everything works fine in development. In production only the things in the app/assets are served properly, the images in the public folder can't be found.
What should I do to make the public folder assets work? I'd like to serve them from CDN as well if possible, but I'm open to any working solution
Current settings:
production.rb
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? #enabled by heroku default settings
config.assets.compile = false
config.assets.digest = true
config.action_controller.asset_host = 'mycode.cloudfront.net'
config.font_assets.origin = '*'
gemfile
# I'm NOT using asset_sync gem
gem 'font_assets', '~> 0.1.12' #this is needed to make googlefonts work
gem 'rails_12factor', '~> 0.0.3', group :production
UPDATE:
working heroku logs
2016-01-25T19:00:24.624690+00:00 heroku[router]: at=info method=GET path="/500.html" host=appfaskyn.herokuapp.com request_id=d1a637be-b539-429a-9fcd-5f4d0025b562 fwd="50.250.214.91" dyno=web.1 connect=2ms service=5ms status=304 bytes=48
2016-01-25T19:00:24.794605+00:00 heroku[router]: at=info method=GET path="/thirdlogo.png" host=appfaskyn.herokuapp.com request_id=41b8aa45-8e70-43ef-af53-b4e0ad44ec8b fwd="50.250.214.91" dyno=web.1 connect=0ms service=4ms status=304 bytes=48
UPDATE2:
Realized that it works w/ certain routes.
So if I hit app/dsfd then it finds the pic with path="/dsfd"
but if I hit app/users/2 (user does not exist anymore, so should be the same page does not exist error) then path="/users/2" can't find the pic.
log if found:
2016-01-29T18:56:14.377420+00:00 heroku[router]: at=info method=GET path="/dsfd" host=www.faskyn.com request_id=76e1c73d-dd22-446f-89b4-096dcbae6f6c fwd="64.245.0.218" dyno=web.1 connect=0ms service=23ms status=404 bytes=840
2016-01-29T18:56:14.320423+00:00 app[web.1]: source=rack-timeout id=76e1c73d-dd22-446f-89b4-096dcbae6f6c wait=0ms timeout=20000ms state=ready
2016-01-29T18:56:14.320609+00:00 app[web.1]: source=rack-timeout id=76e1c73d-dd22-446f-89b4-096dcbae6f6c wait=0ms timeout=20000ms service=1ms state=active
2016-01-29T18:56:14.324730+00:00 app[web.1]: Started GET "/dsfd" for 64.245.0.218 at 2016-01-29 18:56:14 +0000
2016-01-29T18:56:14.331095+00:00 app[web.1]:
2016-01-29T18:56:14.331099+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/fddf"):
2016-01-29T18:56:14.331100+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.4/lib/action_dispa
logs if not found:
Processing by UsersController#show as PNG
2016-01-29T18:49:20.952915+00:00 app[web.1]: Parameters: {"id"=>"thirdlogo"}
2016-01-29T18:49:20.959096+00:00 app[web.1]: User Load (3.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
2016-01-29T18:49:20.963937+00:00 app[web.1]: Completed 404 Not Found in 11ms (ActiveRecord: 4.7ms)
2016-01-29T18:49:20.985358+00:00 heroku[router]: at=info method=GET path="/users/thirdlogo.png" host=www.faskyn.com request_id=e913ee09-3837-4da6-8e7f-f3eebc15de00 fwd="64.245.0.218" dyno=web.1 connect=0ms service=30ms status=404 bytes=840
I have deployed my app to heroku but and I can see the app but the app is NOT accessing the mongolab database. I have tried resetting the database in console with
$ heroku run rake db:reset
but I get this error.
failed with error 13: "not authorized on ENV['MONGOID_DATABASE'] to execute command { dropDatabase: 1 }"
See https://github.com/mongodb/mongo/blob/master/docs/errors.md
Not sure what I am doing wrong, I have not setup an app with mongoid on heroku before, this is my first time
-UPDATE-
Here is the end of the log I have that seems to show the post is not working.
$ heroku logs
2015-09-25T16:20:15.770927+00:00 heroku[router]: at=info method=POST path="/managers" host=beta.herokuapp.com request_id=95709038-02e9-45b1-8300-0aebc287f6c1 fwd="162.239.42.196" dyno=web.1 connect=0ms service=178ms status=500 bytes=1480
2015-09-25T16:20:15.770408+00:00 app[web.1]: D, [2015-09-25T16:20:15.770342 #3] DEBUG -- : MOPED: 10.152.165.9:29821 QUERY database=ENV['MONGOID_DATABASE'] collection=managers selector={"email"=>"sample#email.com"} flags=[] limit=-1 skip=0 batch_size=nil fields={:_id=>1} runtime: 1.0352ms
Here are the router logs...
$ heroku logs --ps router
2015-09-25T20:40:46.935184+00:00 heroku[router]: at=info method=POST path="/managers" host=beta.herokuapp.com request_id=c1673463-a69f-4111-bd4d-01fdb5516ad0 fwd="162.239.42.196" dyno=web.1 connect=2ms service=109ms status=500 bytes=1480
2015-09-25T20:40:47.285029+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=beta.herokuapp.com request_id=1e998283-b02b-4cc5-83f6-7996a6991531 fwd="162.239.42.196" dyno=web.1 connect=1ms service=2ms status=200 bytes=143
2015-09-26T04:45:32.833599+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=beta.herokuapp.com request_id=59ccc2e7-18d4-4c08-8b08-a653f5d11714 fwd="2602:30a:2ef2:ac40:acb1:9144:79b4:affb,66.249.88.51" dyno=web.1 connect=1ms service=4ms status=200 bytes=143
I also see it failing to query the database
2015-09-26T05:03:39.852170+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"WVGY+XLD...A=", "manager"=>{"name"=>"Blah Blah", "company"=>"Blah Blah CO.", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2015-09-26T05:03:40.138442+00:00 app[web.1]: D, [2015-09-26T05:03:40.138321 #3] DEBUG -- : MOPED: 10.152.165.9:29821 COMMAND database=admin command={:ismaster=>1} runtime: 23.5306ms
2015-09-26T05:03:40.146776+00:00 app[web.1]: Completed 500 Internal Server Error in 294ms
2015-09-26T05:03:40.146782+00:00 app[web.1]: Completed 500 Internal Server Error in 294ms
2015-09-26T05:03:40.152205+00:00 app[web.1]:
2015-09-26T05:03:40.152208+00:00 app[web.1]: Moped::Errors::QueryFailure (The operation: #<Moped::Protocol::Query
2015-09-26T05:03:40.152209+00:00 app[web.1]: #length=112
2015-09-26T05:03:40.152211+00:00 app[web.1]: #request_id=4
2015-09-26T05:03:40.152212+00:00 app[web.1]: #response_to=0
2015-09-26T05:03:40.152214+00:00 app[web.1]: #op_code=2004
2015-09-26T05:03:40.152215+00:00 app[web.1]: #flags=[]
2015-09-26T05:03:40.152216+00:00 app[web.1]: #full_collection_name="ENV['MONGOID_DATABASE'].managers"
2015-09-26T05:03:40.152218+00:00 app[web.1]: #skip=0
2015-09-26T05:03:40.152219+00:00 app[web.1]: #limit=-1
2015-09-26T05:03:40.152222+00:00 app[web.1]: #selector={"email"=>"sample#email.com"}
2015-09-26T05:03:40.152224+00:00 app[web.1]: #fields={:_id=>1}>
2015-09-26T05:03:40.152225+00:00 app[web.1]: failed with error 13: "not authorized for query on ENV['MONGOID_DATABASE'].managers"
2015-09-26T05:03:40.152227+00:00 app[web.1]:
2015-09-26T05:03:40.152228+00:00 app[web.1]: See https://github.com/mongodb/mongo/blob/master/docs/errors.md
I figured it out. The db was not connecting because the mongoid.yml file was incorrect. I tweaked the yml file and added the URI to the heroku variables and it worked correctly.
So I have a rails 3.2 app. I created an index.
I followed this guide: https://gist.github.com/nz/2041121 to create an bonsai.rb file in config/initializers/bonsai.rb
It looks like this:
ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL']
# Optional, but recommended: use a single index per application per environment.
# Caveat: This convention not be entirely supported throughout Tire's API.
app_name = Rails.application.class.parent_name.underscore.dasherize
app_env = Rails.env
INDEX_NAME = "#{app_name}-#{app_env}"
But I dosent work, this outprint from the heroku logs:
2013-03-06T17:04:54+00:00 app[web.1]: Processing by SchoolsController#index as HTML
2013-03-06T17:04:54+00:00 app[web.1]: Started GET "/trafikskola?utf8=%E2%9C%93&query=Malm%C3%B6" for 192.165.96.102 at 2013-03-06 17:04:54 +0000
2013-03-06T17:04:54+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "query"=>"Malmö"}
2013-03-06T17:04:58+00:00 heroku[router]: at=info method=GET path=/trafikskola?utf8=%E2%9C%93&query=Malm%C3%B6 host=stormy-escarpment-2346.herokuapp.com fwd="192.165.96.102" dyno=web.1 queue=0 wait=0ms connect=1ms service=3106ms status=500 bytes=643
2013-03-06T17:04:58+00:00 app[web.1]:
2013-03-06T17:04:58+00:00 app[web.1]: app/models/school.rb:19:in `search'
2013-03-06T17:04:58+00:00 app[web.1]: app/controllers/schools_controller.rb:10:in `index'
2013-03-06T17:04:58+00:00 app[web.1]: Completed 500 Internal Server Error in 3073ms
2013-03-06T17:04:58+00:00 app[web.1]: Errno::ECONNREFUSED (Connection refused - connect(2)):
2013-03-06T17:04:58+00:00 app[web.1]:
2013-03-06T17:04:58+00:00 app[web.1]:
My questions:
Should I put somehting in the ELASTICSEARCH_URL in the bonsai.rb file? If yes, then what?
I have created a local index to, does that mean something?
Or is it something else?
The config/initializers/bonsai.rb was right and the problem was I had to index it in production mode also.
So I did this:
heroku rake environment tire:import CLASS=School FORCE=true
And it worked.
Hi I wonder why one of our pages is in trouble....
I run heroku logs in our cli
And this is the output:
C:\Users\Rowell\peekboxbeta>heroku logs --app gentle-beach-4013
2012-07-13T03:41:40+00:00 app[web.12]:
2012-07-13T03:41:40+00:00 app[web.12]: ActionController::RoutingError (No route matches [GET] "/users/assets/pb/f
avicon.jpg"):
2012-07-13T03:41:40+00:00 app[web.12]:
2012-07-13T03:41:40+00:00 app[web.12]:
2012-07-13T03:41:40+00:00 app[web.12]:
2012-07-13T03:41:40+00:00 app[web.12]: cache: [GET /users/assets/pb/favicon.jpg] miss
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/users/assets/pb/favicon.jpg dyno=web.12 queue=0 wait
=0ms service=6ms status=404 bytes=728
2012-07-13T03:41:40+00:00 app[web.5]:
2012-07-13T03:41:40+00:00 app[web.5]:
2012-07-13T03:41:40+00:00 app[web.5]: Started GET "/assets/pb/prev-arrow.png" for 203.177.42.214 at 2012-07-13 11
:41:40 +0800
2012-07-13T03:41:40+00:00 app[web.5]: cache: [GET /assets/pb/prev-arrow.png] stale, valid, store
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/menu-bg.png dyno=web.6 queue=0 wait=0ms se
rvice=3ms status=200 bytes=2835
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/bird.png dyno=web.2 queue=0 wait=0ms servi
ce=4ms status=200 bytes=1833
2012-07-13T03:41:40+00:00 app[web.2]: Started GET "/assets/pb/bird.png" for 203.177.42.214 at 2012-07-13 11:41:40
+0800
2012-07-13T03:41:40+00:00 app[web.2]:
2012-07-13T03:41:40+00:00 app[web.2]:
2012-07-13T03:41:40+00:00 app[web.2]: cache: [GET /assets/pb/bird.png] stale, valid, store
2012-07-13T03:41:40+00:00 app[web.4]:
2012-07-13T03:41:40+00:00 app[web.4]:
2012-07-13T03:41:40+00:00 app[web.4]: Started GET "/assets/pb/twitter_32.png" for 203.177.42.214 at 2012-07-13 11
:41:40 +0800
2012-07-13T03:41:40+00:00 app[web.4]: cache: [GET /assets/pb/twitter_32.png] stale, valid, store
2012-07-13T03:41:40+00:00 app[web.11]:
2012-07-13T03:41:40+00:00 app[web.11]:
2012-07-13T03:41:40+00:00 app[web.11]: Started GET "/assets/pb/bottom-shadow.png" for 203.177.42.214 at 2012-07-1
3 11:41:40 +0800
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/twitter_32.png dyno=web.4 queue=0 wait=0ms
service=4ms status=200 bytes=2313
2012-07-13T03:41:40+00:00 app[web.11]: cache: [GET /assets/pb/bottom-shadow.png] stale, valid, store
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/bottom-shadow.png dyno=web.11 queue=0 wait
=0ms service=6ms status=200 bytes=145
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/prev-arrow.png dyno=web.5 queue=0 wait=0ms
service=5ms status=200 bytes=1043
2012-07-13T03:41:40+00:00 app[web.9]:
2012-07-13T03:41:40+00:00 app[web.9]:
2012-07-13T03:41:40+00:00 app[web.9]: Started GET "/assets/pb/facebook_32.png" for 203.177.42.214 at 2012-07-13 1
1:41:40 +0800
2012-07-13T03:41:40+00:00 app[web.9]: cache: [GET /assets/pb/facebook_32.png] stale, valid, store
2012-07-13T03:41:40+00:00 app[web.3]:
2012-07-13T03:41:40+00:00 app[web.3]:
2012-07-13T03:41:40+00:00 app[web.3]: Started GET "/assets/pb/footer-bullet.png" for 203.177.42.214 at 2012-07-13
11:41:40 +0800
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/facebook_32.png dyno=web.9 queue=0 wait=0m
s service=18ms status=200 bytes=2094
2012-07-13T03:41:40+00:00 app[web.3]: cache: [GET /assets/pb/footer-bullet.png] stale, valid, store
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/footer-bullet.png dyno=web.3 queue=0 wait=
0ms service=21ms status=200 bytes=391
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]: Started GET "/assets/pb/menu-bg.png" for 203.177.42.214 at 2012-07-13 11:41
:40 +0800
2012-07-13T03:41:40+00:00 app[web.6]: Started GET "/assets/pb/header-glow.png" for 203.177.42.214 at 2012-07-13 1
1:41:40 +0800
2012-07-13T03:41:40+00:00 app[web.6]: cache: [GET /assets/pb/menu-bg.png] stale, valid, store
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]: cache: [GET /assets/pb/header-glow.png] stale, valid, store
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]:
2012-07-13T03:41:40+00:00 app[web.6]: Started GET "/assets/pb/twitter-border.png" for 203.177.42.214 at 2012-07-1
3 11:41:40 +0800
2012-07-13T03:41:40+00:00 app[web.6]: cache: [GET /assets/pb/twitter-border.png] stale, valid, store
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/header-glow.png dyno=web.6 queue=0 wait=0m
s service=36ms status=200 bytes=36446
2012-07-13T03:41:40+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/twitter-border.png dyno=web.6 queue=0 wait
=0ms service=37ms status=200 bytes=117
2012-07-13T03:41:41+00:00 app[web.10]:
2012-07-13T03:41:41+00:00 app[web.10]: Started GET "/assets/pb/noise.png" for 203.177.42.214 at 2012-07-13 11:41:
40 +0800
2012-07-13T03:41:41+00:00 app[web.10]:
2012-07-13T03:41:41+00:00 app[web.10]: cache: [GET /assets/pb/noise.png] stale, valid, store
2012-07-13T03:41:41+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/noise.png dyno=web.10 queue=0 wait=0ms ser
vice=957ms status=304 bytes=0
2012-07-13T03:41:41+00:00 app[web.10]:
2012-07-13T03:41:41+00:00 app[web.10]: Started GET "/assets/pb/next-arrow.png" for 203.177.42.214 at 2012-07-13 1
1:41:41 +0800
2012-07-13T03:41:41+00:00 app[web.10]:
2012-07-13T03:41:41+00:00 app[web.10]: cache: [GET /assets/pb/next-arrow.png] stale, valid, store
2012-07-13T03:41:41+00:00 heroku[router]: GET www.peekbox.tv/assets/pb/next-arrow.png dyno=web.10 queue=0 wait=0m
s service=858ms status=304 bytes=0
2012-07-13T03:41:42+00:00 app[web.8]: Started GET "/bo" for 180.194.245.32 at 2012-07-13 11:41:42 +0800
2012-07-13T03:41:42+00:00 app[web.8]:
2012-07-13T03:41:42+00:00 app[web.8]: Processing by InformationController#show as HTML
2012-07-13T03:41:42+00:00 app[web.8]: Parameters: {"username"=>"bo"}
2012-07-13T03:41:42+00:00 app[web.8]:
2012-07-13T03:41:42+00:00 app[web.8]: Rendered information/_pic.html.haml (0.9ms)
2012-07-13T03:41:42+00:00 app[web.8]: Rendered information/_d
ata.html.haml (0.5ms)
2012-07-13T03:41:42+00:00 app[web.8]: Rendered information/_controls.html.haml (6.3ms)
2012-07-13T03:41:43+00:00 app[web.8]: Rendered information/_wall_post.html.haml (1227.0ms)
2012-07-13T03:41:43+00:00 app[web.8]: Rendered information/show.html.haml within layouts/application (1236.4ms)
2012-07-13T03:41:43+00:00 app[web.8]: Completed 500 Internal Server Error in 1242ms
2012-07-13T03:41:43+00:00 app[web.8]:
2012-07-13T03:41:43+00:00 app[web.8]: ActionView::Template::Error (undefined method `profilepic' for nil:NilClass
):
2012-07-13T03:41:43+00:00 app[web.8]: 5: %div.post
2012-07-13T03:41:43+00:00 app[web.8]: 6: -#wall_posts.each do |post|
2012-07-13T03:41:43+00:00 app[web.8]: 8: -unless post.poster.profilepic == nil
2012-07-13T03:41:43+00:00 app[web.8]: 9: %div#wall-post
2012-07-13T03:41:43+00:00 app[web.8]: 7: %div
2012-07-13T03:41:43+00:00 app[web.8]: 10: %div#wall-poster-pic
2012-07-13T03:41:43+00:00 app[web.8]: 11: =link_to (image_t
ag post.poster.profilepic_url(:profile_pic) ,:style => "width:50px;height:76px"), other_user_path(post.poster.use
rname)
2012-07-13T03:41:43+00:00 app[web.8]: app/views/information/_wall_post.html.haml:8:in `block in _app_views_info
rmation__wall_post_html_haml___575386532158736245_58517160'
2012-07-13T03:41:43+00:00 app[web.8]: app/views/information/_wall_post.html.haml:6:in `_app_views_information__
wall_post_html_haml___575386532158736245_58517160'
2012-07-13T03:41:43+00:00 app[web.8]: app/views/information/show.html.haml:20:in `_app_views_information_show_h
tml_haml__598682898842295215_31999300'
2012-07-13T03:41:43+00:00 app[web.8]:
2012-07-13T03:41:43+00:00 app[web.8]:
2012-07-13T03:41:43+00:00 app[web.8]: cache: [GET /bo] miss
2012-07-13T03:41:43+00:00 heroku[router]: GET www.peekbox.tv/bo dyno=web.8 queue=0 wait=0ms service=1252ms status
=500 bytes=728
2012-07-13T03:41:43+00:00 heroku[nginx]: 180.194.245.32 - - [13/Jul/2012:03:41:43 +0000] "GET /bo HTTP/1.0" 500 7
28 "http://www.peekbox.tv/profile" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20
.0.1132.57 Safari/536.11" www.peekbox.tv
2012-07-13T03:41:44+00:00 heroku[nginx]: 180.194.245.32 - - [13/Jul/2012:03:41:44 +0000] "GET /favicon.ico HTTP/1
.0" 304 0 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536
.11" www.peekbox.tv
2012-07-13T03:42:27+00:00 heroku[worker.2]: State changed from crashed to starting
2012-07-13T03:42:31+00:00 heroku[worker.2]: Starting process with command `bundle exec rake jobs:work`
2012-07-13T03:42:32+00:00 heroku[worker.2]: State changed from starting to up
2012-07-13T03:42:37+00:00 app[worker.2]: rake aborted!
2012-07-13T03:42:37+00:00 app[worker.2]: Don't know how to build task 'jobs:work'
2012-07-13T03:42:37+00:00 app[worker.2]:
2012-07-13T03:42:37+00:00 app[worker.2]: (See full trace by running task with --trace)
2012-07-13T03:42:38+00:00 heroku[worker.2]: Process exited with status 1
2012-07-13T03:42:38+00:00 heroku[worker.2]: State changed from up to crashed
C:\Users\Rowell\peekboxbeta>heroku rake db:version
WARNING: `heroku rake` has been deprecated. Please use `heroku run rake` instead.
Running `rake db:version` attached to terminal... failed
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
C:\Users\Rowell\peekboxbeta>heroku rake db:version --app gentle-beach-4013
WARNING: `heroku rake` has been deprecated. Please use `heroku run rake` instead.
Running `rake db:version` attached to terminal... up, run.1
Current version: 20120501142157
I really don't know what happened? When I'm browsing http://peekbox.tv/bo
The error still appears.
Please help me.
Should i run heroku rake db:migrate to heal the errors or any other solutions
We're totally in trouble.
The actual error is a couple of lines down:
2012-07-13T03:41:43+00:00 app[web.8]: ActionView::Template::Error (undefined method `profilepic' for nil:NilClass
You are calling profilepic on an object that is nil, with this code:
post.poster.profilepic_url(:profile_pic)
Therefore one of your post objects has a poster that is nil. Experiment in the console on Heroku (heroku run console) and see if you can find the post that doesn't have a poster.
Putting my "comment" here so the text can be formatted properly. From the terminal try:
$ heroku console
>> Post.all # gives you a list of all the posts
>> Post.first.poster # get first value in "posts" table and run "poster" method
>> Post.find(3) # get post with ID of 3
>> Post.find(3).poster # run "poster" method on post where ID = 3
This should get you started. Your error is showing that post.poster is nil and you want to find out why.
But I agree with #ryanbigg that you need to learn the basics. Judging from your experience level this might not be something you can figure out on your own.
I have a form in my app which is triggering the wrong controller action. Here's the rendered form:
<form id="edit_profile_1" class="simple_form profile windowed" method="post" enctype="multipart/form-data" action="/profiles/1" accept-charset="UTF-8">
<div style="margin:0;padding:0;display:inline">
<input type="hidden" value="✓" name="utf8">
<input type="hidden" value="put" name="_method">
<input type="hidden" value="..." name="authenticity_token">
</div>
....
</form>
So, pretty much a normal form. On my local environment this works fine, it triggers the profiles#update action. However, when deployed on Heroku for some reason this is triggering the profiles#show action, and therefore is not working.
What gives? Has anyone encountered this error before, and do you know how to fix it?
-EDIT- #Laas: Here's the production log:
2011-05-20T21:41:38+00:00 app[web.1]: Started GET "/account" for 98.201.59.6 at 2011-05-20 14:41:38 -0700
2011-05-20T21:41:40+00:00 heroku[router]: GET www.fourthenvironment.org/account dyno=web.1 queue=0 wait=0ms service=2212ms bytes=8672
2011-05-20T21:41:40+00:00 app[web.1]: Connected to NewRelic Service at collector-6.newrelic.com:80
2011-05-20T21:41:40+00:00 heroku[router]: GET www.fourthenvironment.org/javascripts/rails.js dyno=web.1 queue=0 wait=0ms service=2ms bytes=5176
2011-05-20T21:41:41+00:00 heroku[router]: GET www.fourthenvironment.org/javascripts/jquery.144.min.js dyno=web.1 queue=0 wait=0ms service=3ms bytes=78865
2011-05-20T21:41:42+00:00 heroku[router]: GET www.fourthenvironment.org/stylesheets/style.css dyno=web.1 queue=0 wait=0ms service=3ms bytes=63444
2011-05-20T21:41:47+00:00 heroku[router]: GET www.fourthenvironment.org/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms bytes=1672
2011-05-20T21:41:50+00:00 app[web.1]:
2011-05-20T21:41:50+00:00 app[web.1]:
2011-05-20T21:41:50+00:00 app[web.1]: Started POST "/profiles/1" for 98.201.59.6 at 2011-05-20 14:41:50 -0700
2011-05-20T21:41:50+00:00 heroku[router]: POST www.fourthenvironment.org/profiles/1 dyno=web.1 queue=0 wait=0ms service=102ms bytes=420
2011-05-20T21:41:50+00:00 app[web.1]: THIS SHOULD NOT BE TRIGGERED
2011-05-20T21:41:50+00:00 heroku[router]: GET www.fourthenvironment.org/profiles/1 dyno=web.1 queue=0 wait=0ms service=30ms bytes=414
2011-05-20T21:41:50+00:00 app[web.1]:
2011-05-20T21:41:50+00:00 app[web.1]:
2011-05-20T21:41:50+00:00 app[web.1]: Started GET "/account" for 98.201.59.6 at 2011-05-20 14:41:50 -0700
Note the "THIS SHOULD NOT BE TRIGGERED". Here's the controller:
class ProfilesController < ApplicationController
before_filter :authenticate_user!
def show
puts "THIS SHOULD NOT BE TRIGGERED"
redirect_to account_path
end
def edit
#profile = Profile.find(params[:id])
end
def update
puts "profiles#update"
#profile = Profile.find(params[:id])
if #profile.update_attributes(params[:profile])
redirect_to account_path, :notice => t('user.notice.updated')
else
render :action => 'edit'
end
end
end
It turns out the issue was related to the use of the SSL-Requirement Gem. For some reason if you send a request from an SSL page to a non-SSL page while using SSL-requirement it gets redirected. So, to fix, enable SSL-requirement on both ends of the request, and it will work. It looks like going from SSL to non SSL the gem only allows gets -- hence the bug. This looks to be irrelevant as of Rails 3.1 since a new SSL requirement functionality will be baked-in and the gem will not be required.
Many thanks to the Heroku staff for helping isolate this.
Seems to be identical to this problem routing-issues-with-multi-part-forms-on-heroku.
As it is only few days old, maybe it is not a coincidence and there's something awry with Heroku?
Why is the form tag hard coded? Use the form_tag helper
http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html