Giant Rat of Sumatra, The, or Pirates Galore by Sid Fleischman

Drifting into the darkened and fog-covered port of San Diego is a ship unlike any other. Hovering over the silent dock is the ship’s sinister figurehead: a giant yellow rat, its claws and teeth bared. This is the infamous pirate ship The Giant Rat of Sumatra, terror of the Orient. This unique vessel is captained by the equally unique gentleman pirate Captain Gallows. After a glorious career of stealing cargo from other pirate ships, Captain Gallows is coming home to roost. Much to the surprise of his crew, not to mention his loyal cabin boy Shipwreck, Gallows decides to retire from piracy…and to take up ranching!

As much as he wants to remain with Captain Gallows (also known as Don Alejandro) and to help out at the Rancho Candalaria, Shipwreck desires to return to his home in Boston. As an American, he feels awkward living in California, which in 1846, belongs to Mexico. To make matters worse, the United States and Mexico are at war.

Before he is able to find a ship to carry him back home, Don Alejandro entrusts Shipwreck with one last job, to guard his two large emeralds. The former pirate captain has special plans for the valuable jewels, but with a greedy one-armed shipmate hounding Shipwreck, and with the constant threat of highwaymen, will the young cabin boy be able to protect the Captain’s treasure? Also, with the war continuing to rage between the U.S. and Mexico, will Shipwreck finally be able to find his way home?