Ok pretty stuck here. I managed to test the actual _profile.erb page in a standalone action and I had no problems. And I have no problems publishing to a newsfeed. Here''s what I have: activity_publisher.rb def profile_update(user) send_as :profile recipients user.facebook_session.user @activities = user.activities profile render(:partial=>"profile",:assigns=>{:activities=>user.activities}) profile_main render(:partial=>"profile",:assigns=>{:activities=>user.activities}) end publishing is going on in the main controller right now just for testing: public_controller.rb def index ... line 14> ActivityPublisher.deliver_profile_update(current_user) end exception: NoMethodError (You have a nil object when you didn''t expect it! The error occurred while evaluating nil.post): /vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in `set_profile_fbml_without_bebo_adapter'' /vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'' /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in `send_message'' /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in `method_missing'' /app/controllers/public_controller.rb:14:in `index'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark\ '' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ e'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ e'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `ca\ che'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache''
Made some adjustments and still having the same problem. It''s gotta be an API bug? activity_publisher.rb class ActivityPublisher < Facebooker::Rails::Publisher include ApplicationHelper ... def profile_update(user) send_as :profile from user.facebook_session.user recipients user.facebook_session.user fbml = render({ :partial => "profile", :locals => {:activities => user.activities} }) profile(fbml) profile_main(fbml) end ... end _profile.erb This is a test. Publishing Test: >> user = User.find_by_id(1) => #<User id: 1, facebook_id: xxxxxxx, session_key: "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil, email_address: nil, contact_preference: nil, gender: "male", created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20 23:02:16"> >> ActivityPublisher.deliver_profile_update(user) NoMethodError: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.post from /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in `set_profile_fbml_without_bebo_adapter'' from /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'' from /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in `send_message'' from /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in `method_missing'' from (irb):2
Hmm. That seems odd. Sorry this is taking so long for us to figure out. I''ve got a couple of things to try: 1) Update to the newest Facebooker. I made changes this week that might help this. 2) I''m not 100% sure :locals=> will work. I think you need to do :assigns=> (I don''t think that is your problem though) 3) If the upgrade and change don''t help, can you post a new stack trace? I want to make sure I can look at the actual line that is causing the error. Mike On Aug 21, 2008, at 4:16 PM, Allen Walker wrote:> Made some adjustments and still having the same problem. It''s gotta > be an API bug? > > activity_publisher.rb > class ActivityPublisher < Facebooker::Rails::Publisher > > include ApplicationHelper > > ... > def profile_update(user) > send_as :profile > from user.facebook_session.user > recipients user.facebook_session.user > fbml = render({ > :partial => "profile", > :locals => {:activities => user.activities} > }) > profile(fbml) > profile_main(fbml) > end > > ... > end > > _profile.erb > > This is a test. > > Publishing Test: > > > >> user = User.find_by_id(1) > => #<User id: 1, facebook_id: xxxxxxx, session_key: > "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil, > email_address: nil, contact_preference: nil, gender: "male", > created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20 23:02:16"> > >> ActivityPublisher.deliver_profile_update(user) > NoMethodError: You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.post > from /home/slick/meetingup/vendor/plugins/facebooker/lib/ > facebooker/models/user.rb:203:in > `set_profile_fbml_without_bebo_adapter'' > from /home/slick/meetingup/vendor/plugins/facebooker/lib/ > facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'' > from /home/slick/meetingup/vendor/plugins/facebooker/lib/ > facebooker/rails/publisher.rb:287:in `send_message'' > from /home/slick/meetingup/vendor/plugins/facebooker/lib/ > facebooker/rails/publisher.rb:384:in `method_missing'' > from (irb):2 > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Just did a --force on the latest .git via: script/plugin install git://github.com/mmangino/facebooker.git --force restarted mongrel instance. Same error. Full stack trace: Rendered activity_publisher/_profile.fbml.erb (0.00001) NoMethodError (You have a nil object when you didn''t expect it! The error occurred while evaluating nil.post): /vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in `set_profile_fbml_without_bebo_adapter'' /vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'' /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in `send_message'' /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in `method_missing'' /app/controllers/public_controller.rb:14:in `index'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark\ '' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ e'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ e'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `ca\ che'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_manageme\ nt_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 /usr/local/bin/mongrel_rails:19:in `load'' /usr/local/bin/mongrel_rails:19 Rendering /home/slick/meetingup/vendor/plugins/facebooker/templates/layout.erb (200) Mike Mangino wrote:> Hmm. That seems odd. > > Sorry this is taking so long for us to figure out. I''ve got a couple > of things to try: > > 1) Update to the newest Facebooker. I made changes this week that > might help this. > 2) I''m not 100% sure :locals=> will work. I think you need to do > :assigns=> (I don''t think that is your problem though) > 3) If the upgrade and change don''t help, can you post a new stack > trace? I want to make sure I can look at the actual line that is > causing the error. > > Mike > > On Aug 21, 2008, at 4:16 PM, Allen Walker wrote: > >> Made some adjustments and still having the same problem. It''s gotta >> be an API bug? >> >> activity_publisher.rb >> class ActivityPublisher < Facebooker::Rails::Publisher >> >> include ApplicationHelper >> >> ... >> def profile_update(user) >> send_as :profile >> from user.facebook_session.user >> recipients user.facebook_session.user >> fbml = render({ >> :partial => "profile", >> :locals => {:activities => user.activities} >> }) >> profile(fbml) >> profile_main(fbml) >> end >> >> ... >> end >> >> _profile.erb >> >> This is a test. >> >> Publishing Test: >> >> >> >> user = User.find_by_id(1) >> => #<User id: 1, facebook_id: xxxxxxx, session_key: >> "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil, >> email_address: nil, contact_preference: nil, gender: "male", >> created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20 23:02:16"> >> >> ActivityPublisher.deliver_profile_update(user) >> NoMethodError: You have a nil object when you didn''t expect it! >> The error occurred while evaluating nil.post >> from >> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in >> `set_profile_fbml_without_bebo_adapter'' >> from >> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in >> `set_profile_fbml'' >> from >> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in >> `send_message'' >> from >> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in >> `method_missing'' >> from (irb):2 >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > > >
I think the problem comes from using a Facebooker::User as a recipient. It should work, but it doesn''t. I got a pull request for something related to this, but it doesn''t quite fix the bug. In the short term, you can set recipients to either the integer or string of the Facebook id. In the longer term, I''ll need to fix this. I have to pick my wife up from work. I''ll get this patched first thing tomorrow morning. Mike On Aug 21, 2008, at 5:03 PM, Allen Walker wrote:> Just did a --force on the latest .git via: > > script/plugin install git://github.com/mmangino/facebooker.git --force > > restarted mongrel instance. > > Same error. Full stack trace: > > Rendered activity_publisher/_profile.fbml.erb (0.00001) > > > NoMethodError (You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.post): > /vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in > `set_profile_fbml_without_bebo_adapter'' > /vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb: > 43:in `set_profile_fbml'' > /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 287:in `send_message'' > /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 384:in `method_missing'' > /app/controllers/public_controller.rb:14:in `index'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:1162:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:1162:in `perform_action_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:580:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:573:in `perform_action_without_benchmark\ > '' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ > e'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/benchmarking.rb:68:in `perform_action_without_rescu\ > e'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/rescue.rb:201:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/caching/sql_cache.rb:13:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ > active_record/connection_adapters/abstract/query_cache.rb:33:in `ca\ > che'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ > active_record/query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/caching/sql_cache.rb:12:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:529:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:529:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:569:in `process_without_session_manageme\ > nt_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/session_management.rb:130:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:389:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:149:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:107:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:104:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:104:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:120:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:35:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:76:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:74:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:74:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:159:in `process_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:158:in `each'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:158:in `process_client'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:285:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:285:in `initialize'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:285:in `new'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:285:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:268:in `initialize'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:268:in `new'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/ > mongrel.rb:268:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > configurator.rb:282:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > configurator.rb:281:in `each'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > configurator.rb:281:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: > 128:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > command.rb:212:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: > 281 > /usr/local/bin/mongrel_rails:19:in `load'' > /usr/local/bin/mongrel_rails:19 > > Rendering /home/slick/meetingup/vendor/plugins/facebooker/templates/ > layout.erb (200) > > Mike Mangino wrote: >> Hmm. That seems odd. >> >> Sorry this is taking so long for us to figure out. I''ve got a >> couple of things to try: >> >> 1) Update to the newest Facebooker. I made changes this week that >> might help this. >> 2) I''m not 100% sure :locals=> will work. I think you need to >> do :assigns=> (I don''t think that is your problem though) >> 3) If the upgrade and change don''t help, can you post a new stack >> trace? I want to make sure I can look at the actual line that is >> causing the error. >> >> Mike >> >> On Aug 21, 2008, at 4:16 PM, Allen Walker wrote: >> >>> Made some adjustments and still having the same problem. It''s >>> gotta be an API bug? >>> >>> activity_publisher.rb >>> class ActivityPublisher < Facebooker::Rails::Publisher >>> >>> include ApplicationHelper >>> >>> ... >>> def profile_update(user) >>> send_as :profile >>> from user.facebook_session.user >>> recipients user.facebook_session.user >>> fbml = render({ >>> :partial => "profile", >>> :locals => {:activities => user.activities} >>> }) >>> profile(fbml) >>> profile_main(fbml) >>> end >>> >>> ... >>> end >>> >>> _profile.erb >>> >>> This is a test. >>> >>> Publishing Test: >>> >>> >>> >> user = User.find_by_id(1) >>> => #<User id: 1, facebook_id: xxxxxxx, session_key: >>> "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil, >>> email_address: nil, contact_preference: nil, gender: "male", >>> created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20 >>> 23:02:16"> >>> >> ActivityPublisher.deliver_profile_update(user) >>> NoMethodError: You have a nil object when you didn''t expect it! >>> The error occurred while evaluating nil.post >>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/ >>> facebooker/models/user.rb:203:in >>> `set_profile_fbml_without_bebo_adapter'' >>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/ >>> facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'' >>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/ >>> facebooker/rails/publisher.rb:287:in `send_message'' >>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/ >>> facebooker/rails/publisher.rb:384:in `method_missing'' >>> from (irb):2 >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> >> >> >-- Mike Mangino http://www.elevatedrails.com
That appears to work. Thanks. BTW can you give me an example where you use the fb_prompt_permission helper in getting users to give the app access to the profile? B/c this is what I''m using right now in the layout: <fb:if-section-not-added section="profile"> <b>Would you this app to update profile?</b> <fb:add-section-button section="profile" /> </fb:if-section-not-added> I wish there was a way to put this in some kind of dialog box, there probably is. Thanks Mike Mangino wrote:> I think the problem comes from using a Facebooker::User as a > recipient. It should work, but it doesn''t. I got a pull request for > something related to this, but it doesn''t quite fix the bug. In the > short term, you can set recipients to either the integer or string of > the Facebook id. In the longer term, I''ll need to fix this. > > I have to pick my wife up from work. I''ll get this patched first thing > tomorrow morning. > > Mike > > On Aug 21, 2008, at 5:03 PM, Allen Walker wrote: > >> Just did a --force on the latest .git via: >> >> script/plugin install git://github.com/mmangino/facebooker.git --force >> >> restarted mongrel instance. >> >> Same error. Full stack trace: >> >> Rendered activity_publisher/_profile.fbml.erb (0.00001) >> >> >> NoMethodError (You have a nil object when you didn''t expect it! >> The error occurred while evaluating nil.post): >> /vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in >> `set_profile_fbml_without_bebo_adapter'' >> >> /vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in >> `set_profile_fbml'' >> /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in >> `send_message'' >> /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in >> `method_missing'' >> /app/controllers/public_controller.rb:14:in `index'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in >> `send'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in >> `perform_action_without_filters'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in >> `call_filters'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in >> `perform_action_without_benchmark\ >> '' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in >> `perform_action_without_rescu\ >> e'' >> /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in >> `perform_action_without_rescu\ >> e'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in >> `perform_action_without_caching'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in >> `perform_action'' >> >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in >> `ca\ >> che'' >> >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in >> `cache'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in >> `perform_action'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in >> `send'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in >> `process_without_filters'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in >> `process_without_session_manageme\ >> nt_support'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in >> `process'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in >> `process'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in >> `handle_request'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in >> `dispatch'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in >> `synchronize'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in >> `dispatch'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in >> `dispatch_cgi'' >> >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in >> `dispatch'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in >> `process'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in >> `synchronize'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in >> `process'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in >> `process_client'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in >> `each'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in >> `process_client'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in >> `initialize'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in >> `new'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in >> `initialize'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in >> `new'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in >> `each'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in >> `run'' >> >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in >> `run'' >> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 >> /usr/local/bin/mongrel_rails:19:in `load'' >> /usr/local/bin/mongrel_rails:19 >> >> Rendering >> /home/slick/meetingup/vendor/plugins/facebooker/templates/layout.erb >> (200) >> >> Mike Mangino wrote: >>> Hmm. That seems odd. >>> >>> Sorry this is taking so long for us to figure out. I''ve got a couple >>> of things to try: >>> >>> 1) Update to the newest Facebooker. I made changes this week that >>> might help this. >>> 2) I''m not 100% sure :locals=> will work. I think you need to do >>> :assigns=> (I don''t think that is your problem though) >>> 3) If the upgrade and change don''t help, can you post a new stack >>> trace? I want to make sure I can look at the actual line that is >>> causing the error. >>> >>> Mike >>> >>> On Aug 21, 2008, at 4:16 PM, Allen Walker wrote: >>> >>>> Made some adjustments and still having the same problem. It''s gotta >>>> be an API bug? >>>> >>>> activity_publisher.rb >>>> class ActivityPublisher < Facebooker::Rails::Publisher >>>> >>>> include ApplicationHelper >>>> >>>> ... >>>> def profile_update(user) >>>> send_as :profile >>>> from user.facebook_session.user >>>> recipients user.facebook_session.user >>>> fbml = render({ >>>> :partial => "profile", >>>> :locals => {:activities => user.activities} >>>> }) >>>> profile(fbml) >>>> profile_main(fbml) >>>> end >>>> >>>> ... >>>> end >>>> >>>> _profile.erb >>>> >>>> This is a test. >>>> >>>> Publishing Test: >>>> >>>> >>>> >> user = User.find_by_id(1) >>>> => #<User id: 1, facebook_id: xxxxxxx, session_key: >>>> "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil, >>>> email_address: nil, contact_preference: nil, gender: "male", >>>> created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20 23:02:16"> >>>> >> ActivityPublisher.deliver_profile_update(user) >>>> NoMethodError: You have a nil object when you didn''t expect it! >>>> The error occurred while evaluating nil.post >>>> from >>>> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in >>>> `set_profile_fbml_without_bebo_adapter'' >>>> from >>>> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:43:in >>>> `set_profile_fbml'' >>>> from >>>> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:287:in >>>> `send_message'' >>>> from >>>> /home/slick/meetingup/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:384:in >>>> `method_missing'' >>>> from (irb):2 >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >>> -- >>> Mike Mangino >>> http://www.elevatedrails.com >>> >>> >>> >>> >> > > -- > Mike Mangino > http://www.elevatedrails.com > > > >