Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in rails model generator #37

Closed
dfugere opened this issue Mar 28, 2011 · 2 comments
Closed

error in rails model generator #37

dfugere opened this issue Mar 28, 2011 · 2 comments

Comments

@dfugere
Copy link

dfugere commented Mar 28, 2011

/Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/backports-2.0.1/lib/backports/tools.rb:146:in coerce_to': Coercion error: [].to_str => String failed: (TypeError) (undefined methodto_str' for []:Array)
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/backports-2.0.1/lib/backports/tools.rb:108:in convert_to_path' from (eval):2:injoin'
from (eval):2:in map' from (eval):2:injoin'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.5/lib/rails/generators/active_record/model/model_generator.rb:20:in create_model_file' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/task.rb:22:insend'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/backports-2.0.1/lib/backports/tools.rb:104:inmap'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:75:in each' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:inmap'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/group.rb:226:indispatch'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:109:in send' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:109:ininvoke'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/group.rb:269:in _invoke_for_class_method' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/shell.rb:74:inwith_padding'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/group.rb:258:in _invoke_for_class_method' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/group.rb:134:in_invoke_from_option_orm'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/task.rb:22:in send' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/task.rb:22:inrun'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:118:in invoke_task' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:ininvoke_all'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/backports-2.0.1/lib/backports/tools.rb:104:in map' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:75:ineach'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:in map' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/invocation.rb:124:ininvoke_all'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/group.rb:226:in dispatch' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/thor-0.14.6/lib/thor/base.rb:389:instart'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.5/lib/rails/generators.rb:163:in invoke' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.5/lib/rails/commands/generate.rb:10 from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:inrequire'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in new_constants_in' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:inload_dependency'
from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require' from /Users/davidfugere/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.5/lib/rails/commands.rb:17 from script/rails:6:inrequire'
from script/rails:6

@dfugere
Copy link
Author

dfugere commented Mar 28, 2011

The command that caused the error was :
rails g model contact_information name:string value:string kind:string contactable_type:string contactable_id:integer

migration was generated, but not the model file....

@dfugere dfugere closed this as completed Mar 28, 2011
@marcandre
Copy link
Owner

Ah! Just learned that File.join can accept arrays...
Fixed in 2.0.3.
I should make RubySpec more precise about wether paths inside arrays are converted with to_path or not, and backport if need be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants