Errors in executing first RoR app - reg

Hi Friends,

I am brand new to RoR.Kindly help me with the following problem.

Following are the steps i have done.

  1. C:/> rails appone

  2. C:/> cd appone

  3. C:/appone> cd script

  4. C:/appone/script> ruby generate controller appone index

  5. Edited C:/appone/app/controllers/appone_controller.rb

class ApponeController < ApplicationController

def index
time = Time.now
@time = time
end
end

  1. Edited C:\appone\app\views\appone\index.rhtml

Appone#index

Time : <%=@time%>

Find me in app/views/appone/index.rhtml

  1. C:/appone/script> ruby server webrick

  2. in the IE typed the following URL http://localhost:3000/appone/

Got the following error message in the server console:

#<ArgumentError: Anonymous modules have no name to be referenced by>
[“C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:404:in
to_constant_name '", "C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:214:in qualified_nam
e_for’”,
“C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:476:in
const_mi ssing'", "C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:117:in reset_after_dispatch’”, “C:/Insta
ntRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:51:in
dispatch'", "C:/InstantRails/ruby/lib/ruby/gems/1.8/ gems/rails-1.2.3/lib/webrick_server.rb:113:in handle_dispatch’”,
“C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/li
b/webrick_server.rb:79:in service'", "C:/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service’”, “C:/Instant
Rails/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run'", "C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:173:in star
t_thread’”, “C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:in
start'", "C:/InstantRails/ruby/lib/ruby/1.8/webrick/ server.rb:162:in start_thread’”,
“C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:95:in start'", "C:/InstantRails/ruby/ lib/ruby/1.8/webrick/server.rb:92:in each’”,
“C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:in start'", "C:/Instan tRails/ruby/lib/ruby/1.8/webrick/server.rb:23:in start’”,
“C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:82:in start' ", "C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in dispatch’”, “C:/InstantRails/ruby/li
b/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59”,
“C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/c
ustom_require.rb:27:in gem_original_require'", "C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’”,
“C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
requ ire'", "C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in new_consta
nts_in’”,
“C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require '", "C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39", "C:/InstantRails/ruby/lib/ruby/site_ ruby/1.8/rubygems/custom_require.rb:27:in gem_original_require’”,
"C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/cust
om_require.rb:27:in require'", "server:3"] [2007-09-04 18:30:29] ERROR /appone/’ not found.
127.0.0.1 - - [04/Sep/2007:18:30:29 India Standard Time] “GET /appone/
HTTP/1.1” 404 277

  • → /appone/

Any help will be hugely appreciated.

Thanks in advance!!!
regards,
dinesh Venkatesan

There is nothing wrong in controller or view… but something
problem in installation… what version of Instant Rails you are
using… also try to use ruby console window from Instant rails to
create apps…that adds all paths correctly…

On Sep 4, 8:04 am, Dinesh Venkatesan <rails-mailing-l…@andreas-

Also start server using Instant Rails … click on “I” … “rails
application” -> “manage rails applications”…then choose your
applicaton and start server…
good luck in exploring RoR

Narasimha Lakkakula wrote:

There is nothing wrong in controller or view… but something
problem in installation… what version of Instant Rails you are
using… also try to use ruby console window from Instant rails to
create apps…that adds all paths correctly…

On Sep 4, 8:04 am, Dinesh Venkatesan <rails-mailing-l…@andreas-

Hi Narasimha,

Thanks for your reply.
I am using Instant rails version 1.2.3. I have tried using the “start
server with Mongrel”. There also i am facing the same problem.

I will try with ruby console now.

thanks again.
regards,
dinesh V

Dinesh Venkatesan wrote:

Narasimha Lakkakula wrote:

There is nothing wrong in controller or view… but something
problem in installation… what version of Instant Rails you are
using… also try to use ruby console window from Instant rails to
create apps…that adds all paths correctly…

On Sep 4, 8:04 am, Dinesh Venkatesan <rails-mailing-l…@andreas-

Hi Narasimha,

Thanks for your reply.
I am using Instant rails version 1.2.3. I have tried using the “start
server with Mongrel”. There also i am facing the same problem.

I will try with ruby console now.

thanks again.
regards,
dinesh V

Hi,
I tried with ruby console window also. I am facing the same issue. I
hope i am doing something wrong in installation. I will check it.
Meanwhile if anybody finds the problem please guide me.

regards,
dinesh V