Hi Guys, I''ve managed to install Ruby on Rails on Ubuntu 9.10, got it that up and running, installed mysql as well. I use Netbeans 6.8 as the IDE, and from there I can connect from a RoR project to the database with JDBCMYSQL connector, no problem. I can run the project, and get to what seems to be the default index file in the browser, it has a button there to click that shows then the status of the environment, I'', very happy with that. (localhost:8080/RailsApplication6/) However, 2 problems then occurs. I type in localhost:8080/RailsApplication6/book/list and it just throws an error about that that get is not defined in the routes That is just bizarre, since the default route in routes.rb should take care of it right? "No route matches with {:method=>get}" secondly, when restart linux (reboot pc), then when I run the project again, I land up with the page HTTP Status 40 type Status report message descriptionThe requested resource () is not available. for both localhost:8080/RailsApplication6/ localhost:8080/RailsApplication6/book/list It seems that I have some config somewhere wrong and I can''t seem to figure out what. Im following the example from www.tutorialspoint.com/ruby-on-rails/rails-directory-structure.htm I thought it should be as simple as just reading, typing and compiling, but not so it seems. Any pointers are welcome, thanks! -- Posted via http://www.ruby-forum.com/. -- 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.
Len Haasbroek wrote:> Hi Guys, > I''ve managed to install Ruby on Rails on Ubuntu 9.10, got it that up and > running, installed mysql as well. I use Netbeans 6.8 as the IDE,You probably want to drop that. NetBeans is a great IDE, but it''s overkill for Rails. Rails does not really benefit from the use of an IDE; just use a good text editor such as KomodoEdit.> and > from there I can connect from a RoR project to the database with > JDBCMYSQL connector, no problem. > > I can run the project, and get to what seems to be the default index > file in the browser, it has a button there to click that shows then the > status of the environment, I'', very happy with that. > (localhost:8080/RailsApplication6/) > > However, 2 problems then occurs. > I type in localhost:8080/RailsApplication6/book/list > and it just throws an error about that that get is not defined in the > routes > That is just bizarre, since the default route in routes.rb should take > care of it right? > "No route matches with {:method=>get}"The default route is /:controller/:action , so it will try to find a controller and action that match the URL (in this case, "/book/list"). Unless you have a BookController (strange -- normal convention would be BooksController) with an action called "list", you will get routing errors.> > secondly, when restart linux (reboot pc), then when I run the project > again, I land up with the page > HTTP Status 40 > type Status report > message > descriptionThe requested resource () is not available. > for both > localhost:8080/RailsApplication6/ > localhost:8080/RailsApplication6/book/list > > It seems that I have some config somewhere wrong and I can''t seem to > figure out what. Im following the example from > www.tutorialspoint.com/ruby-on-rails/rails-directory-structure.htmTry the examples at http://guides.rails.info .> I thought it should be as simple as just reading, typing and compiling,Ruby is not a compiled language.> but not so it seems. > Any pointers are welcome, thanks!It should be much simpler. I suspect you''re trying to type in a URL that doesn''t yet route to anything. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Hello Marnen, Thank you for your thoughtful feedback.> > The default route is /:controller/:action , so it will try to find a > controller and action that match the URL (in this case, "/book/list"). > Unless you have a BookController (strange -- normal convention would be > BooksController) with an action called "list", you will get routing > errors. >I had a look again. When I create the controller I did it with Book, as the example said: C:\ruby\library\> ruby script/generate controller Book I used the netbeans IDE and said, please create controller Book, and I got: book_controller.rb which I hope is right. Then I did the view thingy: and created a view (aka list.rhtml) now, if my reading skills are up to par, I should get to this by typing in localhost:8080/RailsApplication6/book/list or should it be? localhost:8080/RailsApplication6/book_controller/list I''ve been in IT for 12 years, still it seems like getting the basics to work is the hardest, the coding part I find dead easy when I get the core stuff working, such as compiling hello world! I''m going to take your advice and try your samples link. This should be as easy as falling out of a tree.... to do a simple example. thanks for your time.>> >> secondly, when restart linux (reboot pc), then when I run the project >> again, I land up with the page >> HTTP Status 40 >> type Status report >> message >> descriionThe requested resource () is not available. >> for both >> localhost:8080/RailsApplication6/ >> localhost:8080/RailsApplication6/book/list >> >> It seems that I have some config somewhere wrong and I can''t seem to >> figure out what. Im following the example from >> www.tutorialspoint.com/ruby-on-rails/rails-directory-structure.htm > > Try the examples at http://guides.rails.info . > >> I thought it should be as simple as just reading, typing and compiling, > > Ruby is not a compiled language. > >> but not so it seems. >> Any pointers are welcome, thanks! > > It should be much simpler. I suspect you''re trying to type in a URL > that doesn''t yet route to anything. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org-- Posted via http://www.ruby-forum.com/. -- 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.
> > > I can run the project, and get to what seems to be the default index > file in the browser, it has a button there to click that shows then the > status of the environment, I'', very happy with that. > (localhost:8080/RailsApplication6/) > >I''m curious about what server you are using? -- 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.
Len Haasbroek wrote:> I had a look again. > When I create the controller I did it with Book, as the example said: > C:\ruby\library\> ruby script/generate controller Book > I used the netbeans IDE and said, please create controller Book, and I > got: > book_controller.rb > which I hope is right.If you are using netbeans IDE, right-click on your project --> generate --> controller Name: books View: index Open up configurations --> routes.rb map.resources :books, :controller => :books, :only => :index You can look up how resources work. There are multiple ways of doing this here, but just start with this. Since you are using netbeans, your view will look like such from the IDE: Project Name -- Controllers ---- books_controller.rb (this is your controller) -- Models ---- (none) (read note #1 below) -- Views ---- books ------ index.html.erb (this is your view template) #1 If you specify a scaffold instead of a simple controller, you''d get a full MVC (Model + View + Controller) for books. In addition to books_controller.rb you''d find a book.rb in your models. Scaffolds would be used if you are creating information to store in a database. By default, netbeans would automatically create the map route for you in routes.rb by placing in map.resources :books From netbeans, right-click your project --> run (this will startup your environment). Your page should automatically be displayed (for the root) Go to the end of the line: For me it''s : http://localhost:3000/ .. if for you it''s .. http://localhost:8080/ that''s fine too. http://localhost:8080/books/ Your books view should now display. If you have any questions about netbeans, there is a great support group in netbeans through their forums --> subforum is rails at their main site. Let me know if you have any questions. Also, see the following link to get you started with rails and answering most of the generic questions: http://www.ruby-forum.com/topic/191189 -- Posted via http://www.ruby-forum.com/. -- 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.
Curtis Schofield wrote:>>> I''m curious about what server you are using?I''ve installed the Netbeans package that comes with Glassfish version 3, as well as Webrick. Glassfish runs on port 8080, and Webrick on 3000. Both gave me the same trouble, so the problem wasn''t the webserver part. -- Posted via http://www.ruby-forum.com/. -- 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.
Thanks Elric, I''m going to try your suggestions out over the weekend. Hopefully things will start coming together this side :) I will give feedback again. Regards, Len. -- Posted via http://www.ruby-forum.com/. -- 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.
Curtis Schofield wrote:> What is the output of ''rake routes'' ?(in /home/daddy/RailsApplication6) /:controller/:action/:id /:controller/:action/:id(.:format) -- Posted via http://www.ruby-forum.com/. -- 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.
"I type in localhost:8080/RailsApplication6/book/list" Given that, plus your routes output, perhaps try adding a line like this to your config.rb file (near the top) map.resources :books or map.resources :book Not sure if it would be singular or plural for you. Good luck. --- Jason Soo "I''m going to live forever or die trying." On Sat, Jan 9, 2010 at 5:21 AM, Len Haasbroek <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Curtis Schofield wrote: > > > What is the output of ''rake routes'' ? > > (in /home/daddy/RailsApplication6) > /:controller/:action/:id > /:controller/:action/:id(.:format) > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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.
Here is a simple screencast that creates a scaffold using NetBeans and runs on GlassFish: http://blogs.sun.com/arungupta/entry/screencast_26_develop_run_debug See if this helps. This screencast was created with NetBeans 6.5 RC2 & GlassFish v3 Prelude. And NetBeans 6.8 and GlassFish v3 are the latest versions. But I''ve shown this demo multiple times in different talks. Another difference is I recorded the screencast on Windows and showed the demo on Mac and yours is Ubuntu. See if you can have this simple sample working. -Arun On Jan 8, 11:36 pm, Len Haasbroek <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Curtis Schofield wrote: > > > I''m curious about what server you are using? > > I''ve installed the Netbeans package that comes with Glassfish version 3, > as well as Webrick. Glassfish runs on port 8080, and Webrick on 3000. > Both gave me the same trouble, so the problem wasn''t the webserver part. > > -- > Posted viahttp://www.ruby-forum.com/.-- 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.
Len Haasbroek wrote:> Curtis Schofield wrote: > >> What is the output of ''rake routes'' ? > > (in /home/daddy/RailsApplication6) > /:controller/:action/:id > /:controller/:action/:id(.:format)Then /book/list will not be routable, because it does not match either of these patterns. However, /book/list/1 will work. Try it. The fact that you''re asking these questions makes me think you''ve started with a bad tutorial example. Start over with the Rails Guides, and get rid of NetBeans. You''ll be a lot happier. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. --0015174c3ff2651cb6047cbe445c Content-Type: text/plain; charset=ISO-8859-1 -- 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. --0015174c3ff2651cb6047cbe445c--
On Sat, Jan 9, 2010 at 9:02 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Len Haasbroek wrote: > > Curtis Schofield wrote: > > > >> What is the output of ''rake routes'' ? > > > > (in /home/daddy/RailsApplication6) > > /:controller/:action/:id > > /:controller/:action/:id(.:format) > > Then /book/list will not be routable, because it does not match either > of these patterns. However, /book/list/1 will work. Try it. > > The fact that you''re asking these questions makes me think you''ve > started with a bad tutorial example. Start over with the Rails Guides, > and get rid of NetBeans. You''ll be a lot happier. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >Yes, I have to agree with Marnen that you should use Rails Guides which can be found here: http://guides.rubyonrails.org Good luck, -Conrad> -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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.
This is a great suggestion: On Fri, Jan 8, 2010 at 2:21 PM, Alpha Blue <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Len Haasbroek wrote: > > > I had a look again. > > When I create the controller I did it with Book, as the example said: > > C:\ruby\library\> ruby script/generate controller Book > > I used the netbeans IDE and said, please create controller Book, and I > > got: > > book_controller.rb > > which I hope is right. > > If you are using netbeans IDE, right-click on your project --> generate > --> controller > > Name: books > View: index > > Open up configurations --> routes.rb > > map.resources :books, :controller => :books, :only => :index > > You can look up how resources work. There are multiple ways of doing > this here, but just start with this. > > Since you are using netbeans, your view will look like such from the > IDE: > > Project Name > -- Controllers > ---- books_controller.rb (this is your controller) > -- Models > ---- (none) (read note #1 below) > -- Views > ---- books > ------ index.html.erb (this is your view template) > > #1 If you specify a scaffold instead of a simple controller, you''d get a > full MVC (Model + View + Controller) for books. In addition to > books_controller.rb you''d find a book.rb in your models. Scaffolds > would be used if you are creating information to store in a database. > By default, netbeans would automatically create the map route for you in > routes.rb by placing in map.resources :books > > From netbeans, right-click your project --> run (this will startup your > environment). > > Your page should automatically be displayed (for the root) > > Go to the end of the line: > > For me it''s : > > http://localhost:3000/ > > .. if for you it''s .. http://localhost:8080/ that''s fine too. > > http://localhost:8080/books/ > > Your books view should now display. > > If you have any questions about netbeans, there is a great support group > in netbeans through their forums --> subforum is rails at their main > site. Let me know if you have any questions. > > Also, see the following link to get you started with rails and answering > most of the generic questions: > > http://www.ruby-forum.com/topic/191189 > > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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.