The positioning of single molecules between nanoscale electrodes has allowed their use as functional units in electronic devices. Although the electrical transport in such devices has been widely explored, optical measurements have been restricted to the observation of electroluminescence from nanocrystals and nanoclusters and from molecules in a scanning tunnelling microscope setup. In this Letter, we report the observation of electroluminescence from the core of a rod-like molecule between two metallic single-walled carbon nanotube electrodes forming a rigid solid-state device. We also develop a simple model to explain the onset voltage for electroluminescence. These results suggest new characterization and functional possibilities, and demonstrate the potential of carbon nanotubes for use in molecular electronics.