As an addendum: Replicators cannot produce all food; they're unable to produce certain spices. Also, using replicators requires energy. However, most of a natural economy is null and void, thanks to mostly-free food and energy. This simply could mean that the Star Trek universe is based upon information. An information-based economy would help to make a bit more sense of TNG and Voyager, since their missions roughly coincide; gather information.