title: Ruby on Rails: Hello World
body: <p>Long-time Java dev, first-time Ruby dev. Trying to reach the "hello world" step with a Rails app, and having difficulty.</p>
  
  <p>I'm positive that I'm missing something basic here. That being said, none of StackOverflow's "Questions with similar titles" nor Google's "ruby rails hello world" hits (or variants thereof) have clarified what I'm missing.</p>
  
  <p>I've got ruby (v1.9.3p194), gem (1.8.23) and rails (3.2.3) installed via RVM. I generated a controller using:</p>
  
  <pre><code>rails generate controller common
  </code></pre>
  
  <p>In the default "config/routes.rb", I have the following two routing attempts:</p>
  
  <pre><code>Web::Application.routes.draw do
    root :to =&gt; "common#index"
    match ':controller(/:action(/:id))(.:format)'
  end
  </code></pre>
  
  <p>When I initially ran "rails server" and loaded "http://localhost:3000/common" in my browser, I saw the following:</p>
  
  <pre><code>Unknown action
  The action 'index' could not be found for CommonController
  </code></pre>
  
  <p>I learned this is because "index" was not defined for my common controller, so I've edited "app/controllers/common_controller.rb" to contain the following:</p>
  
  <pre><code>class CommonController &lt; ApplicationController
  
    def index
    end
  
  end
  </code></pre>
  
  <p>I now see the following at "http://localhost:3000/common" in my browser:</p>
  
  <pre><code>Template is missing
  Missing template common/index, application/index with {:locale=&gt;[:en], :formats=&gt;[:html], :handlers=&gt;[:erb, :builder, :coffee]}. Searched in: * "/coding/workspace/[My] Toolbag/web/app/views"
  </code></pre>
  
  <p>I see the same thing at root, which makes sense.</p>
  
  <p>From what I've found, this is clearly due to not having anything rendering in my controller, so I believe it should instead be checking for something at "app/views/common/index.html.erb" -- however, I do have a file there, containing the following:</p>
  
  <pre><code>&lt;h1&gt;Hello World&lt;/h1&gt;
  </code></pre>
  
  <p>I've also tried renaming "index.html.erb" to "_index.html.erb", "index.html", and "index", all based on Googling variants of the console error "ActionView::Missing Template" and the similar browser output above.</p>
  
  <p>Many of the Google results contain snippets of suggestions, but without clear guidance on which file(s) to edit with said suggestions, or else with repeats of the steps that I've already taken above.</p>
  
  <p>If anyone could advise what I'm missing, I'd appreciate it.</p>
  
  <p>PS: I'm running as super-user, with "root:root" ownership of all files referenced here. Might rails be intended to be run as a regular user? Doesn't seem like that would let me get quite this far if it was the case, though.</p>