wrong number of arguments (1 for 0) | Rails | Facepalm

I am working on a simple web application to help out dieudonne and came across a seemingly random error on the rails stack while trying to build a simple email functionality. My thought process was to scaffold a “message” model and have a “send” function in the controller that would then parse the mail content using LiquidTemplating and send out the email with a delayed job process.

 

Well, all fine and dandy till I hit this error,

__define_callbacks activesupport (4.0.2) lib/active_support/callbacks.rb
364365366367368369370371372373374

      # if it was not yet defined.
      # This generated method plays caching role.
      def __define_callbacks(kind, object) #:nodoc:
        name = __callback_runner_name(kind)
        unless object.respond_to?(name, true)
          str = object.send("_#{kind}_callbacks").compile
          class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
            def #{name}() #{str} end
            protected :#{name}
          RUBY_EVAL
      end

There is no information about this out there and no one on the interwebs seems to be talking about that particular line:

str = object.send("_#{kind}_callbacks").compile

which is where unicorn says I am going wrong. Now, I know I have done no changes in the rails stack and thought maybe it was the model name and maybe I couldnt create a “message” model. So I made a “communication” model and scaffolded it. No dice.

A week later, when I decided to give it another go, I realized that I ve been inadvertently overriding the “send” method from the rails Controller class. Rename the function “send” to something else and voila, things are back to normal.

facepalm.

I wish unicorn was better at telling me the issue started at the controller and not at some point in the rails stack. oh well.

 

Fixed Bug: Applications Disappear after Over the Air Install – iPhone App Development

I have been working with a couple of iPhone apps recently and in all cases I ve had to set up an Over the Air install client to distribute the apps to all the dev devices. My friend, Ulf wrote a ruby cms (hosted on github) for this very purpose (Thanks Much!). Here is a bug that seems to have baffled some people and never been an issue for some people.

Bug: The app installs but as soon as it does, the icon disappears from the screen.

This can be irritating, understandably.

Issue: The app id doesn’t match the provisioning profile.

Fix: Found Here

It turns out to be that the bundle-identifier in the app-info.plist file did not match the adhoc provisioning profile identifier. This property has to match the APP ID in the provisioning portal that you created the profile with.
i.e. My APP ID = com.TheApp.*
WRONG:
bundle-identifier
com.SomeOtherName.Whatever
CORRECT:
bundle-identifier
com.TheApp.TheAppName
Also, make sure that you replace ‘TheAppName’ with the same value as ‘Product Name’ in your project + target settings.