If you want to use Nominatim (OSM's first choice for geocoding and reverse geocoding) then you also need to install a local copy of the OSM database. This step is already included in the Nominatim installation procedure under the section Import and index OSM data. You need to download either the whole planet file or some extract. Also note that you probably want to perform periodic updates to keep your local OSM database up to date.
You don't need the rails port if you don't want to provide your own API and the whole web frontend.