The 20th Century Fox film beat out the action fantasy "Sucker Punch," released by Warner Bros. The girl-power movie opened at No. 2 with $19 million.
The previous weekend's top movie, "Limitless" starring Bradley Cooper, slid to third place with $15.2 million, raising its total to $41.3 million.
"Rodrick Rules" did a bit more business than its predecessor, "Diary of a Wimpy Kid," which opened a year ago with $22.1 million.
The "Wimpy Kid" movies are based on the children's books by Jeff Kinney about a timid youth trying to cope at school and home.
Mathew McConaughey's legal thriller "The Lincoln Lawyer" and Johnny Depp's animated flick "Rango" round out the top five.
1. "Diary of a Wimpy Kid: Rodrick Rules," $24.4 million.
2. "Sucker Punch," $19 million.
3. "Limitless," $15.2 million.
4. "The Lincoln Lawyer," $11 million.
5. "Rango," $9.8 million.
6. "Battle: Los Angeles," $7.6 million.
7. "Paul," $7.5 million.
8. "Red Riding Hood," $4.3 million.
9. "The Adjustment Bureau," $4.2 million.
10. "Mars Needs Moms!", $2.2 million.
The Associated Press contributed to this report.