Unable to resolve sequelize package

I recently decided to use a more opinionated migrations manager for a new microservice we are building on top of the loopback framework. In my opinion, loopback’s automigrate feature leaves a lot to be desired. After doing some search, we settled on Sequelize. I got started with the instructions on http://docs.sequelizejs.com/en/latest/docs/migrations/. Interestingly enough, I kept getting the following error when I tried to init the sequelize project:

Unable to resolve sequelize package in /Users/looneydoodle/…

After going through the forums and the github issues, I realized the error wasnt really in the code. It was because I had to install the sequelize package separately and it was not set as a dependency for the sequelize-cli package. So I ran npm install sequelize and we were on our merry way.


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

      # 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}

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.


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.