Yes, you can rent formal cloths (tux) on board the ship, however it must be done prior to sailing because the tux must be sized. Go to Carnival.com, under "My Cruise" click on "Shop Gifts & Services" once that page opens up, on the left hand side of the page, under "Ship Delivery" click on "Formal Wear Rentals". This will take you to the page for renting a tux, $87 for the week. You must download the form on the page and go get sized somewhere. Then you must call the 1-800 number shown on that page to place your order for the tux. You must order it at least 1 week prior to cruising.
I rented a tux last time I cruised on the Liberty, and probably will this time. You get the tux, 1 shirt, shoes, cuff links, bow tie, and cummerbund for the week. Not a bad deal, considering you don't have to put up with messing with a suit that gets wringles when traveling.