I just got the following feedback posted to my ONLamp.com Rails tutorial. I haven''t yet tried to duplicate this myself (I just woke up and I''m getting ready for work), but no one else reported this. Of course, it likely that no one else is running Rails 0.9.5 either since it was just released. I''m going to look at this later today, but any help in the interim would be appreciated. Thanks, Curt -----Original Message----- From: help-Kn0X/Ljn+e1t1OO0OYaSVA@public.gmane.org [mailto:help-Kn0X/Ljn+e1t1OO0OYaSVA@public.gmane.org] Sent: Tuesday, January 25, 2005 8:27 PM To: curt-fk6st7iWb8MAvxtiuMwx3w@public.gmane.org; chromatic-jwAc06hyVjVBDgjK7y7TUQ@public.gmane.org Subject: New talkback on "Rolling with Ruby on Rails" A new message was posted to your article or weblog! Rolling with Ruby on Rails http://www.oreillynet.com/pub/a/onlamp/2005/01/20/rails.html?page=last#threa d Subject: Article disparity Author: Swirlee Text of message: This is a great article, but I''ve discovered one small snafu. When I create the MyTest controller, it creates a my_text_controller.rb, just as the article says. However, when I add the "Hello World" method and browse to the URL in the article (localhost/MyTest/), I get an error (LoadError in MyTest#index). However, if I put an underscore in the URL, i.e. localhost/My_Test/, it works perfectly. I''m not sure if this is just an error in the article or if there''s been a change in the Rails implementation, but it could bear correcting. FYI, I''m running Ruby 1.8.2 and Rails 0.9.5. -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.3 - Release Date: 1/24/2005
James G. Stallings II
2005-Jan-26 12:44 UTC
Re: Does anyone know what is going on here? - 0.9.3 probs again?
Hi all, I can''t say I''ve had the problem that Curt is having, but I am having some other problems and I''m running rails 0.9.3 (See earlier posts). I there some way I use some earlier version? My apologies, I''m completely new to ruby/gem/rails, though I am a veteran of LAMP of some years. Oh, I''m using apache 1.3.33 on Mac OS X too. My current issue is: Apache config right out of the box with just enough config mods to make the server work and support the rails app on port 7000 demo app straight from the tutorial no modifications to .htaccess When I hit http://rubyrails:7000/myapp I get the database listing (at http://rubyrails/myapp/list#list), but neither the links for new record nor edit record work (destroy record works oddly enough); they crash and report the following to the browser: NoMethodError in Webshots#new Showing //usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.1/lib/action_controller/templates/rescues//_request_and_response.rhtml/ where line *#3* raised _undefined method `rewrite'' for #<Url:0x1633404>_ |1: <% if defined?(Breakpoint) %> 2: <br /><br /> 3: <%= form_tag({:params => {}, :only_path => true}, "method" => @request.method) %> 4: <input type="hidden" name="BP-RETRY" value="1" /> 5: 6: <% for key, values in @params %> | Trace of template inclusion: /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.1/lib/action_controller/templates/rescues/template_error.rhtml Thanks for any assistance! Cheers, Twitch
James G. Stallings II
2005-Jan-26 12:57 UTC
Re: Does anyone know what is going on here? - 0.9.3 probs again? ADDENDUM
I should mention that the first time I did the tutorial, it worked; but I was using WEBbrick at that time. Cheers Twitch James G. Stallings II wrote:> > Hi all, > > I can''t say I''ve had the problem that Curt is having, but I am having > some other problems and I''m running rails 0.9.3 (See earlier posts). > > I there some way I use some earlier version? My apologies, I''m > completely new to ruby/gem/rails, though I am a veteran of LAMP of > some years. > > Oh, I''m using apache 1.3.33 on Mac OS X too. > > My current issue is: > > Apache config right out of the box with just enough config mods to > make the server work and support the rails app on port 7000 > demo app straight from the tutorial > > no modifications to .htaccess > > When I hit http://rubyrails:7000/myapp I get the database listing (at > http://rubyrails/myapp/list#list), but neither the links for new > record nor edit record work (destroy record works oddly enough); they > crash and report the following to the browser: > > > NoMethodError in Webshots#new > > Showing > //usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.1/lib/action_controller/templates/rescues//_request_and_response.rhtml/ > where line *#3* raised _undefined method `rewrite'' for #<Url:0x1633404>_ > > |1: <% if defined?(Breakpoint) %> > 2: <br /><br /> > 3: <%= form_tag({:params => {}, :only_path => true}, "method" => > @request.method) %> > 4: <input type="hidden" name="BP-RETRY" value="1" /> > 5: 6: <% for key, values in @params %> > | > > Trace of template inclusion: > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.3.1/lib/action_controller/templates/rescues/template_error.rhtml > > > > > Thanks for any assistance! > > Cheers, > Twitch > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
James G. Stallings II
2005-Jan-26 14:42 UTC
Re: Does anyone know what is going on here? - 0.9.3 probs again? ADDENDUM
I have a logfile (log level 9) from the rewrite rules engine if that might help... Cheers, Twitch
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Curt Hibbs wrote:> Subject: Article disparity > Author: Swirlee > > Text of message: > This is a great article, but I''ve discovered one small snafu. When I create > the MyTest controller, it creates a my_text_controller.rb, just as the > article says. However, when I add the "Hello World" method and browse to the > URL in the article (localhost/MyTest/), I get an error (LoadError in > MyTest#index). However, if I put an underscore in the URL, i.e. > localhost/My_Test/, it works perfectly. I''m not sure if this is just an > error in the article or if there''s been a change in the Rails > implementation, but it could bear correcting. FYI, I''m running Ruby 1.8.2 > and Rails 0.9.5.Rails is looking for the my_test controller. MyTest in URL is mapped to mytest controller, which doesn''t exist. My_Test works since the URL is downcased. I suggest that the dispatcher should call controller_name.underscore rather than just controller_name.downcase. Since people do ./script/generate controller MyTest, they expect to see MyTest in URL. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFB97CYAQHALep9HFYRAi1kAJ0eYzdCguXV6T+Lgid9NlIzricFUgCg3y/U QlgEebRffNRysiYeuSJn58M=XZX/ -----END PGP SIGNATURE-----
Jeremy Kemper wrote:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Curt Hibbs wrote: > > Subject: Article disparity > > Author: Swirlee > > > > Text of message: > > This is a great article, but I''ve discovered one small snafu. > When I create > > the MyTest controller, it creates a my_text_controller.rb, just as the > > article says. However, when I add the "Hello World" method and > browse to the > > URL in the article (localhost/MyTest/), I get an error (LoadError in > > MyTest#index). However, if I put an underscore in the URL, i.e. > > localhost/My_Test/, it works perfectly. I''m not sure if this is just an > > error in the article or if there''s been a change in the Rails > > implementation, but it could bear correcting. FYI, I''m running > Ruby 1.8.2 > > and Rails 0.9.5. > > Rails is looking for the my_test controller. MyTest in URL is mapped to > mytest controller, which doesn''t exist. My_Test works since the URL is > downcased. > > I suggest that the dispatcher should call controller_name.underscore > rather than just controller_name.downcase. Since people do > ./script/generate controller MyTest, they expect to see MyTest in URL.But why is only one user (out of many) who have tried the tutorial run into this? Is it because he''s using Rails 0.9.5 while all the others were using 0.9.4? Curt
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Curt Hibbs wrote:> But why is only one user (out of many) who have tried the tutorial run into > this? Is it because he''s using Rails 0.9.5 while all the others were using > 0.9.4?Maybe this user is the only to try a CamelCased controller name. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFB98rfAQHALep9HFYRAjO6AJ9VXV6czJmkJaPNKEPa8O4tJp+qrgCfe4sj GC6/2ja351IJZ5CJLbvTJq0=iDv6 -----END PGP SIGNATURE-----
Jeremy Kempe wrote:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Curt Hibbs wrote: > > But why is only one user (out of many) who have tried the > tutorial run into > > this? Is it because he''s using Rails 0.9.5 while all the others > were using > > 0.9.4? > > Maybe this user is the only to try a CamelCased controller name. > jeremyI was just able to try this out myself, and its definitely being caused by Rails 0.9.5. After creating a controller like this: ruby script\generate controller MyTest and creating an index method inside the controller, these URL fail: http://127.0.0.1:3000/mytest/ http://127.0.0.1:3000/MyTest/ and these URLs work: http://127.0.0.1:3000/my_test/ http://127.0.0.1:3000/My_Test/ I think I''m going to have the editor of ONLamp update the tutorial to specifically install Rails 0.9.4 -- its going to look bad if users get inexplicable errors while trying it out. I want things to go smoothly so that we can entice more developers to come on over from the dark side. Curt
Curt Hibbs
2005-Jan-26 18:46 UTC
RE: Does anyone know what is going on here? - 0.9.3 probsagain? ADDENDUM
James G. Stallings II wrote:> > I should mention that the first time I did the tutorial, it worked; but > I was using WEBbrick at that time.Its definitely caused by changes in Rails 0.9.5. I''m having my tutorial changed to specifically install Rails 0.9.4. Curt
James G. Stallings II
2005-Jan-26 19:19 UTC
Re: Does anyone know what is going on here? - 0.9.3 probsagain? ADDENDUM
The problem I am having is on rails 0.9.4.1. I remain unconvinced that I have buggered something up; I''m one of those dark-side developers you were mentioning in another post - I''ve been doing cgi on apache, well, ever since there was an apache. Some C form handlers in the early days (''94/''95), and then quite a lot of perl since then (I completely wore out a camel book and bought a second one). Is there a way to specify version at rails install time? I''d like something different from what I have, even if its just to compare mileage. Cheers! Twitch Curt Hibbs wrote:>James G. Stallings II wrote: > > >>I should mention that the first time I did the tutorial, it worked; but >>I was using WEBbrick at that time. >> >> > >Its definitely caused by changes in Rails 0.9.5. I''m having my tutorial >changed to specifically install Rails 0.9.4. > >Curt > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
Curt Hibbs
2005-Jan-26 19:38 UTC
RE: Does anyone know what is going on here? -0.9.3 probsagain? ADDENDUM
James G. Stallings II wrote:> > The problem I am having is on rails 0.9.4.1. I remain unconvinced that I > have buggered something up; I''m one of those dark-side developers you > were mentioning in another post - I''ve been doing cgi on apache, well, > ever since there was an apache. Some C form handlers in the early days > (''94/''95), and then quite a lot of perl since then (I completely wore > out a camel book and bought a second one). > > Is there a way to specify version at rails install time? I''d like > something different from what I have, even if its just to compare mileage.To uninstall your current version of rails: gem uninstall rails To install a specific version: gem install rails -v <version> For example: gem install rails -v 0.9.3 Curt
James G. Stallings II
2005-Jan-26 20:44 UTC
Re: Does anyone know what is going on here? -0.9.3 probsagain? ADDENDUM
Curt Hibbs wrote:>James G. Stallings II wrote: > > >>The problem I am having is on rails 0.9.4.1. I remain unconvinced that I >>have buggered something up; I''m one of those dark-side developers you >>were mentioning in another post - I''ve been doing cgi on apache, well, >>ever since there was an apache. Some C form handlers in the early days >>(''94/''95), and then quite a lot of perl since then (I completely wore >>out a camel book and bought a second one). >> >>Is there a way to specify version at rails install time? I''d like >>something different from what I have, even if its just to compare mileage. >> >> > >To uninstall your current version of rails: > > gem uninstall rails > >To install a specific version: > > gem install rails -v <version> > >For example: > > gem install rails -v 0.9.3 > >Curt > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >Thanks Curt. I just rolled back to 0.9.2 and it had no impact on my issues. I''m REALLY starting to suspect my webserver config. Cheers, Twitch
Dick Davies
2005-Jan-26 23:16 UTC
Re: Does anyone know what is going on here? - 0.9.3 probsagain? ADDENDUM
* James G. Stallings II <twitch-kuaf+BvAnvdypLqBFPtG/w@public.gmane.org> [0120 19:20]:> The problem I am having is on rails 0.9.4.1. I remain unconvinced that I > have buggered something up; I''m one of those dark-side developers you > were mentioning in another post - I''ve been doing cgi on apache, well, > ever since there was an apache. Some C form handlers in the early days > (''94/''95), and then quite a lot of perl since then (I completely wore > out a camel book and bought a second one).This isn''t down to the mod_rewrite in .htaccess, is it? Do you get the same problem with webrick (./script/server) ? -- ''You were doing well until everyone died'' -- God Rasputin :: Jack of All Trades - Master of Nuns