diff --git a/rules.module b/rules.module
index 719852c..9e4ec8f 100644
--- a/rules.module
+++ b/rules.module
@@ -8,6 +8,22 @@
 // hook_init().
 require_once dirname(__FILE__) . '/modules/events.inc';
 
+/** Rules >=2.4 introduces a class called 'RulesEventHandlerEntityBundle' found in
+ * 'includes/rules.event.inc', so we include this file for versions older than 2.4
+ * in order to prevent a bug at node/2090511.
+ */
+$result = db_query("SELECT schema_version FROM {system} WHERE name = :name", array(
+  ':name' => 'rules',
+));
+
+if ($result) {
+  while ($row = $result->fetchAssoc()) {
+    if ($row['schema_version'] <7210) {
+      require_once dirname(__FILE__) . '/includes/rules.event.inc';
+    }
+  }
+}
+
 /**
  * Implements hook_module_implements_alter().
  */
