$ rails generate controller home index This created app/views/home/index.html.erb. I deleted the index.html with: $ rm public/index.html I edited my routes.rb file as follows: Blog::Application.routes.draw do root :to => "home#index" But when I go to http://localhost:3000 I get the following message: Unable to connect. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2011 06:12, wordmystic <bwilsonnow-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> $ rails generate controller home index > > This created app/views/home/index.html.erb. > > I deleted the index.html with: $ rm public/index.html > > I edited my routes.rb file as follows: > > Blog::Application.routes.draw do > root :to => "home#index" > > But when I go to http://localhost:3000 I get the following message: > > Unable to connect.Is that a browser message saying that it cannot connect to that URL or a rails message? If a rails message please give the full error message. Have you started the rails server? If so what do you see in the terminal window when you start the server and try to open the page? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The "Unable to Connect" message is a Firefox browser message. When I open the server in the command prompt window I get a long list of options and a description and example of the "rails new" command. Then the cursor positioned after, "C:\Sites>. Bruce On Apr 5, 1:32 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 5 April 2011 06:12, wordmystic <bwilson...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > $ rails generate controller home index > > > This created app/views/home/index.html.erb. > > > I deleted the index.html with: $ rm public/index.html > > > I edited my routes.rb file as follows: > > > Blog::Application.routes.draw do > > root :to => "home#index" > > > But when I go tohttp://localhost:3000I get the following message: > > > Unable to connect. > > Is that a browser message saying that it cannot connect to that URL or > a rails message? If a rails message please give the full error > message. > Have you started the rails server? If so what do you see in the > terminal window when you start the server and try to open the page? > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2011 16:37, Bruce <bwilsonnow-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: Please don''t top post, it makes it difficult to follow the thread, insert your reply at appropriate points in previous message. Thanks.> The "Unable to Connect" message is a Firefox browser message. > > When I open the server in the command prompt window I get a long list > of options and a description and example of the "rails new" command. > Then the cursor positioned after, "C:\Sites>.It sounds like the server is not starting, you should get a message saying that it is started. What command are you running to start it? Copy the command you enter and the first lines of the output and paste them here. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 5, 8:46 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 5 April 2011 16:37, Bruce <bwilson...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > Please don''t top post, it makes it difficult to follow the thread, > insert your reply at appropriate points in previous message. Thanks. > > > The "Unable to Connect" message is a Firefox browser message. > > > When I open the server in the command prompt window I get a long list > > of options and a description and example of the "rails new" command. > > Then the cursor positioned after, "C:\Sites>. > > It sounds like the server is not starting, you should get a message > saying that it is started. What command are you running to start it? > Copy the command you enter and the first lines of the output and paste > them here.C:\Sites> rails server Usage: rails new APP_PATH [options] Options: [--skip-gemfile] # Don''t create a Gemfile ...and so on. Bruce> > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2011 17:02, Bruce <bwilsonnow-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> On Apr 5, 8:46 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> On 5 April 2011 16:37, Bruce <bwilson...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: >> >> Please don''t top post, it makes it difficult to follow the thread, >> insert your reply at appropriate points in previous message. Thanks. >> >> > The "Unable to Connect" message is a Firefox browser message. >> >> > When I open the server in the command prompt window I get a long list >> > of options and a description and example of the "rails new" command. >> > Then the cursor positioned after, "C:\Sites>. >> >> It sounds like the server is not starting, you should get a message >> saying that it is started. What command are you running to start it? >> Copy the command you enter and the first lines of the output and paste >> them here. > > C:\Sites> rails serverYou should be in the root folder of your application, the same folder where you typed rails generate controller ....> Usage: > rails new APP_PATH [options]It is telling you that the only valid command in this directory is rails new as you are not at the root of an existing app. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''ve made that mistake myself a time or two (still new to Rails). The idea, Bruce, is that you want to run your *specific* web application. If you think of it that way, that may help. And not that I have a ton of experience, but I''ve found that when I need to start the server then I''m usually inside that application''s directory somewhere anyway. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 5, 9:34 am, dana tassler <dana.tass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve made that mistake myself a time or two (still new to Rails). > > The idea, Bruce, is that you want to run your *specific* web > application. > > If you think of it that way, that may help. > > And not that I have a ton of experience, but I''ve found that when I > need to start the server then I''m usually inside that application''s > directory somewhere anyway.Thanks. Here is what I tried. The new rails application I created is in the folder c:\Sites\blog\app I start the shell command on that folder and get this: => Bootiing WEBrick => Rails 3.0.4 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Then a few seconds goes by and it continues with: exiting c:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1l8/gems/activessupport -3.0.4/lib/active_ support/dependencies.rb:235:in ''''load'': C:/Sites/blog/config/routes.rb: 62: syntax error, unexpected $end, expecting KEND <SyntaxError> from C:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/gems/ activesupport-3.0.4/lib/active_support/dependencies.rb:235:in ''load'' from lists more ''load_....s'' and more. It''s a long list It ends with: from C:/Sites/blog/config.ru:1:in ''new'' from C:/Sites/blog/config.ru:1 C:\Sites|blog\app> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 5 April 2011 20:44, Bruce <bwilsonnow-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> On Apr 5, 9:34 am, dana tassler <dana.tass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I''ve made that mistake myself a time or two (still new to Rails). >> >> The idea, Bruce, is that you want to run your *specific* web >> application. >> >> If you think of it that way, that may help. >> >> And not that I have a ton of experience, but I''ve found that when I >> need to start the server then I''m usually inside that application''s >> directory somewhere anyway. > > Thanks. Here is what I tried. > > The new rails application I created is in the folder c:\Sites\blog\appI think it is probably the blog folder that you should be in, the root folder of the app, not the ''app'' folder of the root folder of the app :) In fact it probably doesn''t matter, it seems to have worked out what to do.> I start the shell command on that folder and get this: > > => Bootiing WEBrick > => Rails 3.0.4 application starting in development on http://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > > Then a few seconds goes by and it continues with: > > exiting > c:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1l8/gems/activessupport > -3.0.4/lib/active_ > support/dependencies.rb:235:in ''''load'': C:/Sites/blog/config/routes.rb: > 62: syntax error, unexpected $end, expecting KEND <SyntaxError>That is saying it has found a syntax error at line 62 of routes.rb, which is likely the end. You probably have an ''end'' missing or something similar. If you cannot see it paste the complete file here. You can check whether you have got it right without starting the server by running rake routes which should show the valid routes you have specified. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 5, 1:02 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 5 April 2011 20:44, Bruce <bwilson...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > On Apr 5, 9:34 am, dana tassler <dana.tass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I''ve made that mistake myself a time or two (still new to Rails). > > >> The idea, Bruce, is that you want to run your *specific* web > >> application. > > >> If you think of it that way, that may help. > > >> And not that I have a ton of experience, but I''ve found that when I > >> need to start the server then I''m usually inside that application''s > >> directory somewhere anyway. > > > Thanks. Here is what I tried. > > > The new rails application I created is in the folder c:\Sites\blog\app > > I think it is probably the blog folder that you should be in, the root > folder of the app, not the ''app'' folder of the root folder of the app > :) In fact it probably doesn''t matter, it seems to have worked out > what to do. > > > I start the shell command on that folder and get this: > > > => Bootiing WEBrick > > => Rails 3.0.4 application starting in development onhttp://0.0.0.0:3000 > > => Call with -d to detach > > => Ctrl-C to shutdown server > > > Then a few seconds goes by and it continues with: > > > exiting > > c:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1l8/gems/activessupport > > -3.0.4/lib/active_ > > support/dependencies.rb:235:in ''''load'': C:/Sites/blog/config/routes.rb: > > 62: syntax error, unexpected $end, expecting KEND <SyntaxError> > > That is saying it has found a syntax error at line 62 of routes.rb, > which is likely the end. You probably have an ''end'' missing or > something similar. If you cannot see it paste the complete file here. > You can check whether you have got it right without starting the > server by running > rake routes > which should show the valid routes you have specified. > > ColinThank you Dana and Thank you, Thank you, Thank you, Colin! I don''t know how my routes.rb file got so messed up, but it was a bit of a jumble. Got it right and now am able to generate the index page with http://localhost:3000. The help was much appreciated. Bruce -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.