HighDots Forums  

script/generate broken on vendored rails2.3.4 project

Ruby On Rails Talk Ruby On Rails programming language mailing list


Discuss script/generate broken on vendored rails2.3.4 project in the Ruby On Rails Talk forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rick DeNatale
 
Posts: n/a

Default script/generate broken on vendored rails2.3.4 project - 10-30-2009 , 01:06 PM






I was trying to add cucumber to a project which is using rails2.3.4
(which is vendored). The script/generate cucumber step is failing.

I first thought that this was a problem specific to cucumber but it
appears that script/generate is broken in general:

$ script/generate model foo --backtrace
undefined method `exists' for #<ActiveSupport::BufferedLogger:0x000001017500d8>
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:321:in
`directory'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:47:in
`block in send_actions'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`each'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`send_actions'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:31:in
`replay'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:42:in
`invoke!'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/scripts.rb:31:in
`run'
/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/commands/generate.rb:6:in
`<top (required)>'
script/generate:3:in `require'
script/generate:3:in `<main>'

The problem is that the logger in the generator doesn't seem to be the
right type here's the directory method in
railsties/rails_generator/commands.rb which is failing:

def directory(relative_path)
path = destination_path(relative_path)
if File.exist?(path)
logger.exists relative_path
else
logger.create relative_path
# ...

Instead of an ActiveSupport::BufferecLogger, logger seems like it
should be something else, but I haven't yet been able to figure out
where it's set and what has gone wrong.

Any ideas?



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #2  
Old   
Rick DeNatale
 
Posts: n/a

Default Re: script/generate broken on vendored rails2.3.4 project - 10-30-2009 , 01:52 PM






So the following seems to only happen when I run script/generate under
ruby 1.9.1

If I use 1.8.7 script/generate works!

On Fri, Oct 30, 2009 at 1:06 PM, Rick DeNatale <rick.denatale (AT) gmail (DOT) com> wrote:
Quote:
I was trying to add cucumber to a project which is using rails2.3.4
(which is vendored). * The script/generate cucumber step is failing.

I first thought that this was a problem specific to cucumber but it
appears that script/generate is broken in general:

$ script/generate model foo --backtrace
undefined method `exists' for #<ActiveSupport::BufferedLogger:0x000001017500d8
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:321:in
`directory'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:47:in
`block in send_actions'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`each'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`send_actions'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:31:in
`replay'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:42:in
`invoke!'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/scripts.rb:31:in
`run'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/commands/generate.rb:6:in
`<top (required)>'
*script/generate:3:in `require'
*script/generate:3:in `<main>'

The problem is that the logger in the generator doesn't seem to be the
right type here's the directory method in
railsties/rails_generator/commands.rb which is failing:

* * * *def directory(relative_path)
* * * * *path = destination_path(relative_path)
* * * * *if File.exist?(path)
* * * * * *logger.exists relative_path
* * * * *else
* * * * * *logger.create relative_path
*# ...

Instead of an ActiveSupport::BufferecLogger, logger seems like it
should be something else, but I haven't yet been able to figure out
where it's set and what has gone wrong.

Any ideas?



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
  #3  
Old   
Rick DeNatale
 
Posts: n/a

Default Re: script/generate broken on vendored rails2.3.4 project - 10-30-2009 , 03:15 PM



I tracked it down.

The problem was being caused by the log_buddy gem
http://github.com/relevance/log_buddy

This adds a logger method to Object which clobbers the Rails generator
script commands logger.

That cost me an hour or two.

On Fri, Oct 30, 2009 at 1:06 PM, Rick DeNatale <rick.denatale (AT) gmail (DOT) com> wrote:
Quote:
I was trying to add cucumber to a project which is using rails2.3.4
(which is vendored). * The script/generate cucumber step is failing.

I first thought that this was a problem specific to cucumber but it
appears that script/generate is broken in general:

$ script/generate model foo --backtrace
undefined method `exists' for #<ActiveSupport::BufferedLogger:0x000001017500d8
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:321:in
`directory'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:47:in
`block in send_actions'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`each'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:46:in
`send_actions'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/manifest.rb:31:in
`replay'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/commands.rb:42:in
`invoke!'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/rails_generator/scripts.rb:31:in
`run'
*/Users/rick/fifthrail/legalpm/vendor/rails/railties/lib/commands/generate.rb:6:in
`<top (required)>'
*script/generate:3:in `require'
*script/generate:3:in `<main>'

The problem is that the logger in the generator doesn't seem to be the
right type here's the directory method in
railsties/rails_generator/commands.rb which is failing:

* * * *def directory(relative_path)
* * * * *path = destination_path(relative_path)
* * * * *if File.exist?(path)
* * * * * *logger.exists relative_path
* * * * *else
* * * * * *logger.create relative_path
*# ...

Instead of an ActiveSupport::BufferecLogger, logger seems like it
should be something else, but I haven't yet been able to figure out
where it's set and what has gone wrong.

Any ideas?



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale



--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.