For a website running Ruby code you’ll probably want Ruby on Rails.
However, if you don’t even know the basics of Ruby I’d emphatically
recommend learning Ruby first.
There are plenty of good tutorials out there which are just a quick
Google away from your fingertips. http://www.ruby-lang.org/en/documentation/quickstart/
example, not what I am trying to actually publish)
So how would I go about turning this code into a website people would
visit to have their names generated backwards?
Doesn’t prompt for a user, but using Sinatra [1] you can easily do
something like this:
#!/usr/bin/env ruby
encoding: UTF-8
require ‘sinatra’
get ‘/:name’ do
“Hi #{params[:name].reverse}”
end
If you run this code and browse to localhost:4567/mario you can see the
result. However that’s just the tip of the iceberg for a full featured
application.
I don’t even know how to run the code in the “Command Prompt with Ruby”
thing.
Fix that first, then you can start writing web-apps. Doesn’t work the
other way around.