Kristian Mandrup
2010-Jan-27 16:41 UTC
Rails 3 generators for scaffolding models according to selected ORM - how?
I have installed Mongo DB and created my first Rails 3 model generator as a gem, which can create Mongo Mapper models in a Rails 3 project :) See http://github.com/kristianmandrup/mongo_model_r3 Also available from gemcutter as mongo_model 0.2.1. I am now trying to create a scaffold generator using this same model.... In my Rails 3 app: config/application.rb config.generators do |g| g.orm :active_record g.template_engine :erb g.test_framework :test_unit, :fixture => true end --- Looking at existing Rails 3 generators for inspiration: class ModelGenerator ... hook_for :orm, :required => true end --- class ScaffoldControllerGenerator ... class_option :orm, :banner => "NAME", :type => :string, :required => true, :desc => "ORM to generate the controller for" end --- I wonder how I can use the ORM setting to set the ORM of the app to ''Mongo DB'' (or Mongo Mapper?) and then have the scaffolder generate the appropriate model. I assume that it is simply by name? So that if I have g.orm :mongo_model Then it will look for a mongo_model generator to create the model...!? But when I try to use scaffold... (even with a newly created r3 app, having only done a $ gem bundle) $ script/generate scaffold Post name:string index /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ruby/ 1.9.1/gems/activesupport-3.0.pre/lib/active_support/whiny_nil.rb:49:in `method_missing'': undefined method `to_sym'' for nil:NilClass (NoMethodError) from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/ generated_attribute.rb:7:in `initialize'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/named_base.rb: 52:in `new'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/named_base.rb: 52:in `block in parse_attributes!'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/named_base.rb: 50:in `map'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/named_base.rb: 50:in `parse_attributes!'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/named_base.rb: 22:in `initialize'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators/ resource_helpers.rb:25:in `initialize'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/vendor/thor-0.12.3/lib/thor/ group.rb:35:in `new'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/vendor/thor-0.12.3/lib/thor/ group.rb:35:in `block in start'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/vendor/thor-0.12.3/lib/thor/ base.rb:354:in `start'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/vendor/thor-0.12.3/lib/thor/ group.rb:28:in `start'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/generators.rb:163:in `invoke'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/railties-3.0.pre/lib/rails/commands/generate.rb:10:in `<top (required)>'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/activesupport-3.0.pre/lib/active_support/ dependencies.rb:167:in `require'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/activesupport-3.0.pre/lib/active_support/ dependencies.rb:167:in `block in require'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/activesupport-3.0.pre/lib/active_support/ dependencies.rb:537:in `new_constants_in'' from /Users/kristianconsult/my_rails/rails3_apps/r3_test/vendor/gems/ ruby/1.9.1/gems/activesupport-3.0.pre/lib/active_support/ dependencies.rb:167:in `require'' from script/generate:3:in `<main>'' I get this error in all the rails 3 applications I have so far created :( Anone has any ideas/comments/suggestions for this? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-27 16:59 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
So it works as long as I only specify controller/model and attributes Here I set g.orm :mongo_model But where do I map this orm symbol to the correct model generator I wonder? $ script/generate scaffold Person name:string error mongo_model [not found] route resources :people invoke scaffold_controller create app/controllers/people_controller.rb invoke erb ... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anuj Dutta
2010-Jan-27 17:26 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
2010/1/27 Kristian Mandrup <kmandrup@gmail.com>> So it works as long as I only specify controller/model and attributes > > Here I set g.orm :mongo_model > > But where do I map this orm symbol to the correct model generator I > wonder? > > $ script/generate scaffold Person name:string > error mongo_model [not found] > route resources :people > invoke scaffold_controller > create app/controllers/people_controller.rb > invoke erb > ... > >Just saw your repository and I think you should put the generator files in a directory called "*generators" *or* "rails_generators*". And have a look at http://github.com/snusnu/rails3_datamapper for datamapper but I am sure you will get a good idea of what needs to be done. Anuj --> You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Anuj DUTTA -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-27 17:39 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Hi Anuj Dutta, Yes, I found rails3_datamapper by snusnu previously and had a look at it since I also thought I could get some inspiration from it. I think the repository you mention is an old one, my mongo_model_m3 repo works just fine, and I have a *generators* directory! When I try to run scaffold on the rails3_datamapper application I get an error: kristian-mandrups-macbook-pro:datamapper_on_rails3 kristianconsult$ script/generate scaffold Post /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:601:in `to_constant_name'': Anonymous modules have no name to be referenced by (ArgumentError) from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:407:in `qualified_name_for'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:115:in `rescue in const_missing'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:105:in `const_missing'' ... -- Looking inside *rails3_datamapper-0.10.2* data_mapper.rb module DataMapper module Generators class Base < ::Rails::Generators::NamedBase #:nodoc: ... end I notice the convention is to have a module DataMapper::Generators as a wrapper for the generator class. Is this important? Any other required conventions to have an ORM generator binding correctly "picked up" by rails 3? Kristian> > Just saw your repository and I think you should put the generator files in a > directory called "*generators" *or* "rails_generators*". > > And have a look athttp://github.com/snusnu/rails3_datamapperfor datamapper > but I am sure you will get a good idea of what needs to be done. > > Anuj > > -- > > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > Anuj DUTTA-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anuj Dutta
2010-Jan-27 17:46 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
2010/1/27 Kristian Mandrup <kmandrup@gmail.com>> Hi Anuj Dutta, > > Yes, I found rails3_datamapper by snusnu previously and had a look at > it since I also thought I could get some inspiration from it. > I think the repository you mention is an old one, my mongo_model_m3 > repo works just fine, and I have a *generators* directory! > > When I try to run scaffold on the rails3_datamapper application I get > an error: > kristian-mandrups-macbook-pro:datamapper_on_rails3 kristianconsult$ > script/generate scaffold Post > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:601:in `to_constant_name'': Anonymous modules have no > name to be referenced by (ArgumentError) > from > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:407:in `qualified_name_for'' > from > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:115:in `rescue in const_missing'' > from > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:105:in `const_missing'' > ... > -- > > Looking inside *rails3_datamapper-0.10.2* data_mapper.rb > > > module DataMapper > module Generators > class Base < ::Rails::Generators::NamedBase #:nodoc: > ... > end > > I notice the convention is to have a module DataMapper::Generators as > a wrapper for the generator class. Is this important? > Any other required conventions to have an ORM generator binding > correctly "picked up" by rails 3? > > Kristian > >Hello Kristian, Sorry, I did not know you were doing that already. Right, so can you point me to your repository please and I will run it on my system and debug it. Thanks Anuj> > > > > Just saw your repository and I think you should put the generator files > in a > > directory called "*generators" *or* "rails_generators*". > > > > And have a look athttp://github.com/snusnu/rails3_datamapperfordatamapper > > but I am sure you will get a good idea of what needs to be done. > > > > Anuj > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > "Ruby on Rails: Core" group. > > > To post to this group, send email to rubyonrails-core@googlegroups.com > . > > > To unsubscribe from this group, send email to > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > > Anuj DUTTA > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Anuj DUTTA -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Martin Gamsjaeger
2010-Jan-27 17:46 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Anuj and Kristian, First of all, I''d like to point out that the canonical repo for rails3_datamapper is http://github.com/dkubb/rails3_datamapper .. mine is just a fork, altho i''m the primary committer to dkubb''s repo. Just wanted to get that out of the way, since gems will always be built from dkubb''s repo. @Kristian From what I can tell, the namespace *is* important, in that it at least will be picked up when listing all available generators with ./script/generate. Putting the generators in the DataMapper namespace will list them below the data_mapper section. On Wed, Jan 27, 2010 at 18:39, Kristian Mandrup <kmandrup@gmail.com> wrote:> Hi Anuj Dutta, > > Yes, I found rails3_datamapper by snusnu previously and had a look at > it since I also thought I could get some inspiration from it. > I think the repository you mention is an old one, my mongo_model_m3 > repo works just fine, and I have a *generators* directory! > > When I try to run scaffold on the rails3_datamapper application I get > an error: > kristian-mandrups-macbook-pro:datamapper_on_rails3 kristianconsult$ > script/generate scaffold Post > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:601:in `to_constant_name'': Anonymous modules have no > name to be referenced by (ArgumentError) > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:407:in `qualified_name_for'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:115:in `rescue in const_missing'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:105:in `const_missing'' > ... > -- > > Looking inside *rails3_datamapper-0.10.2* data_mapper.rb > > > module DataMapper > module Generators > class Base < ::Rails::Generators::NamedBase #:nodoc: > ... > end > > I notice the convention is to have a module DataMapper::Generators as > a wrapper for the generator class. Is this important? > Any other required conventions to have an ORM generator binding > correctly "picked up" by rails 3? > > Kristian > > >> >> Just saw your repository and I think you should put the generator files in a >> directory called "*generators" *or* "rails_generators*". >> >> And have a look athttp://github.com/snusnu/rails3_datamapperfor datamapper >> but I am sure you will get a good idea of what needs to be done. >> >> Anuj >> >> -- >> >> > You received this message because you are subscribed to the Google Groups >> > "Ruby on Rails: Core" group. >> > To post to this group, send email to rubyonrails-core@googlegroups.com. >> > To unsubscribe from this group, send email to >> > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> > . >> > For more options, visit this group at >> >http://groups.google.com/group/rubyonrails-core?hl=en. >> >> -- >> Anuj DUTTA > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-27 18:45 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Hi Martin and Anuj, Thanks for the tip! I found your repo previously, but this is the pure gem. I guess I would have to integrate it with the demo rails app or maybe @Anuj could update his repo? I will upload my current repo ASAP so you can have a look ;) Thanks! Kris On Jan 27, 6:46 pm, Martin Gamsjaeger <gamsnj...@gmail.com> wrote:> Anuj and Kristian, > > First of all, I''d like to point out that the canonical repo for > rails3_datamapper is http://github.com/dkubb/rails3_datamapper.. mine > is just a fork, altho i''m the primary committer to dkubb''s repo. Just > wanted to get that out of the way, since gems will always be built > from dkubb''s repo. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-27 18:48 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Here is my repo ;) Thanks! http://github.com/kristianmandrup/datamapper_rails3_demo> Hello Kristian, > > Sorry, I did not know you were doing that already. Right, so can you point > me to your repository please and I will run it on my system and debug it. > > Thanks > > Anuj >> > > > Just saw your repository and I think you should put the generator files > > in a > > > directory called "*generators" *or* "rails_generators*". > > > > And have a look athttp://github.com/snusnu/rails3_datamapperfordatamapper > > > but I am sure you will get a good idea of what needs to be done. > > > > Anuj > > > > -- > > > > > You received this message because you are subscribed to the Google > > Groups > > > > "Ruby on Rails: Core" group. > > > > To post to this group, send email to rubyonrails-core@googlegroups.com > > . > > > > To unsubscribe from this group, send email to > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > > > Anuj DUTTA > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > Anuj DUTTA-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anuj Dutta
2010-Jan-27 18:55 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
2010/1/28 Kristian Mandrup <kmandrup@gmail.com>> Here is my repo ;) Thanks! > > http://github.com/kristianmandrup/datamapper_rails3_demo > >I will see if I can spot the issue. FYI, you do not need to check the actual gem directories in just the .gem files (in the cache). Anuj> > Hello Kristian, > > > > Sorry, I did not know you were doing that already. Right, so can you > point > > me to your repository please and I will run it on my system and debug it. > > > > Thanks > > > > Anuj > > > > > > > > > Just saw your repository and I think you should put the generator > files > > > in a > > > > directory called "*generators" *or* "rails_generators*". > > > > > > And have a look athttp:// > github.com/snusnu/rails3_datamapperfordatamapper > > > > but I am sure you will get a good idea of what needs to be done. > > > > > > Anuj > > > > > > -- > > > > > > > You received this message because you are subscribed to the Google > > > Groups > > > > > "Ruby on Rails: Core" group. > > > > > To post to this group, send email to > rubyonrails-core@googlegroups.com > > > . > > > > > To unsubscribe from this group, send email to > > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > <rubyonrails-core%252Bunsubscribe@googlegroups.com<rubyonrails-core%25252Bunsubscribe@googlegroups.com> > > > > > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/rubyonrails-core?hl=en. > > > > > > -- > > > > Anuj DUTTA > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Ruby on Rails: Core" group. > > > To post to this group, send email to rubyonrails-core@googlegroups.com > . > > > To unsubscribe from this group, send email to > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > > Anuj DUTTA > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Anuj DUTTA -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anuj Dutta
2010-Jan-27 19:31 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
2010/1/28 Anuj Dutta <dutta.anuj@googlemail.com>> > > 2010/1/28 Kristian Mandrup <kmandrup@gmail.com> > > Here is my repo ;) Thanks! >> >> http://github.com/kristianmandrup/datamapper_rails3_demo >> >> > >Hello, I just created a new Rails3 app and used your gemfile and scaffold data_mapper works fine for me. How are you creating your rails3 project? Anuj> I will see if I can spot the issue. FYI, you do not need to check the > actual gem directories in just the .gem files (in the cache). > > Anuj > > > > >> > Hello Kristian, >> > >> > Sorry, I did not know you were doing that already. Right, so can you >> point >> > me to your repository please and I will run it on my system and debug >> it. >> > >> > Thanks >> > >> > Anuj >> > >> >> > >> > > > Just saw your repository and I think you should put the generator >> files >> > > in a >> > > > directory called "*generators" *or* "rails_generators*". >> > >> > > > And have a look athttp:// >> github.com/snusnu/rails3_datamapperfordatamapper >> > > > but I am sure you will get a good idea of what needs to be done. >> > >> > > > Anuj >> > >> > > > -- >> > >> > > > > You received this message because you are subscribed to the Google >> > > Groups >> > > > > "Ruby on Rails: Core" group. >> > > > > To post to this group, send email to >> rubyonrails-core@googlegroups.com >> > > . >> > > > > To unsubscribe from this group, send email to >> > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> >> > >> > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> >> <rubyonrails-core%252Bunsubscribe@googlegroups.com<rubyonrails-core%25252Bunsubscribe@googlegroups.com> >> > >> > >> > > > > . >> > > > > For more options, visit this group at >> > > > >http://groups.google.com/group/rubyonrails-core?hl=en. >> > >> > > > -- >> > > > Anuj DUTTA >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Ruby on Rails: Core" group. >> > > To post to this group, send email to >> rubyonrails-core@googlegroups.com. >> > > To unsubscribe from this group, send email to >> > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> >> > >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/rubyonrails-core?hl=en. >> > >> > -- >> > Anuj DUTTA >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> >> > > > -- > Anuj DUTTA >-- Anuj DUTTA -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Martin Gamsjaeger
2010-Jan-28 01:23 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Anuj and Kristian, I just tried ./script/generate scaffold Profile nick:string and it worked just fine. I probably also forgot to mention that i have a sample app showing datamapper working with rails3 too. http://github.com/snusnu/datamapper_on_rails3 cheers snusnu On Wed, Jan 27, 2010 at 20:31, Anuj Dutta <dutta.anuj@googlemail.com> wrote:> > > 2010/1/28 Anuj Dutta <dutta.anuj@googlemail.com> >> >> >> 2010/1/28 Kristian Mandrup <kmandrup@gmail.com> >>> >>> Here is my repo ;) Thanks! >>> >>> http://github.com/kristianmandrup/datamapper_rails3_demo >>> >> >> > > > Hello, > > I just created a new Rails3 app and used your gemfile and scaffold > data_mapper works fine for me. How are you creating your rails3 project? > > Anuj > > > > >> >> I will see if I can spot the issue. FYI, you do not need to check the >> actual gem directories in just the .gem files (in the cache). >> >> Anuj >> >> >> >>> >>> > Hello Kristian, >>> > >>> > Sorry, I did not know you were doing that already. Right, so can you >>> > point >>> > me to your repository please and I will run it on my system and debug >>> > it. >>> > >>> > Thanks >>> > >>> > Anuj >>> > >>> >>> > >>> > > > Just saw your repository and I think you should put the generator >>> > > > files >>> > > in a >>> > > > directory called "*generators" *or* "rails_generators*". >>> > >>> > > > And have a look >>> > > > athttp://github.com/snusnu/rails3_datamapperfordatamapper >>> > > > but I am sure you will get a good idea of what needs to be done. >>> > >>> > > > Anuj >>> > >>> > > > -- >>> > >>> > > > > You received this message because you are subscribed to the >>> > > > > Google >>> > > Groups >>> > > > > "Ruby on Rails: Core" group. >>> > > > > To post to this group, send email to >>> > > > > rubyonrails-core@googlegroups.com >>> > > . >>> > > > > To unsubscribe from this group, send email to >>> > > > > >>> > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >>> > > >>> > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> >>> > >>> > > > > . >>> > > > > For more options, visit this group at >>> > > > >http://groups.google.com/group/rubyonrails-core?hl=en. >>> > >>> > > > -- >>> > > > Anuj DUTTA >>> > >>> > > -- >>> > > You received this message because you are subscribed to the Google >>> > > Groups >>> > > "Ruby on Rails: Core" group. >>> > > To post to this group, send email to >>> > > rubyonrails-core@googlegroups.com. >>> > > To unsubscribe from this group, send email to >>> > > >>> > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >>> > > . >>> > > For more options, visit this group at >>> > >http://groups.google.com/group/rubyonrails-core?hl=en. >>> > >>> > -- >>> > Anuj DUTTA >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Core" group. >>> To post to this group, send email to rubyonrails-core@googlegroups.com. >>> To unsubscribe from this group, send email to >>> rubyonrails-core+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-core?hl=en. >>> >> >> >> >> -- >> Anuj DUTTA > > > > -- > Anuj DUTTA > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Anuj Dutta
2010-Jan-28 01:32 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
2010/1/28 Martin Gamsjaeger <gamsnjaga@gmail.com>> Anuj and Kristian, > > I just tried > > ./script/generate scaffold Profile nick:string > > and it worked just fine. I probably also forgot to mention that i have > a sample app showing datamapper working with rails3 too. > > http://github.com/snusnu/datamapper_on_rails3 > > cheers > snusnu >It was working fine for me too. Thanks, anyways. Anuj> > On Wed, Jan 27, 2010 at 20:31, Anuj Dutta <dutta.anuj@googlemail.com> > wrote: > > > > > > 2010/1/28 Anuj Dutta <dutta.anuj@googlemail.com> > >> > >> > >> 2010/1/28 Kristian Mandrup <kmandrup@gmail.com> > >>> > >>> Here is my repo ;) Thanks! > >>> > >>> http://github.com/kristianmandrup/datamapper_rails3_demo > >>> > >> > >> > > > > > > Hello, > > > > I just created a new Rails3 app and used your gemfile and scaffold > > data_mapper works fine for me. How are you creating your rails3 project? > > > > Anuj > > > > > > > > > >> > >> I will see if I can spot the issue. FYI, you do not need to check the > >> actual gem directories in just the .gem files (in the cache). > >> > >> Anuj > >> > >> > >> > >>> > >>> > Hello Kristian, > >>> > > >>> > Sorry, I did not know you were doing that already. Right, so can you > >>> > point > >>> > me to your repository please and I will run it on my system and debug > >>> > it. > >>> > > >>> > Thanks > >>> > > >>> > Anuj > >>> > > >>> > >>> > > >>> > > > Just saw your repository and I think you should put the generator > >>> > > > files > >>> > > in a > >>> > > > directory called "*generators" *or* "rails_generators*". > >>> > > >>> > > > And have a look > >>> > > > athttp://github.com/snusnu/rails3_datamapperfordatamapper > >>> > > > but I am sure you will get a good idea of what needs to be done. > >>> > > >>> > > > Anuj > >>> > > >>> > > > -- > >>> > > >>> > > > > You received this message because you are subscribed to the > >>> > > > > Google > >>> > > Groups > >>> > > > > "Ruby on Rails: Core" group. > >>> > > > > To post to this group, send email to > >>> > > > > rubyonrails-core@googlegroups.com > >>> > > . > >>> > > > > To unsubscribe from this group, send email to > >>> > > > > > >>> > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > >>> > > > >>> > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > <rubyonrails-core%252Bunsubscribe@googlegroups.com<rubyonrails-core%25252Bunsubscribe@googlegroups.com> > > > >>> > > >>> > > > > . > >>> > > > > For more options, visit this group at > >>> > > > >http://groups.google.com/group/rubyonrails-core?hl=en. > >>> > > >>> > > > -- > >>> > > > Anuj DUTTA > >>> > > >>> > > -- > >>> > > You received this message because you are subscribed to the Google > >>> > > Groups > >>> > > "Ruby on Rails: Core" group. > >>> > > To post to this group, send email to > >>> > > rubyonrails-core@googlegroups.com. > >>> > > To unsubscribe from this group, send email to > >>> > > > >>> > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> > > > >>> > > . > >>> > > For more options, visit this group at > >>> > >http://groups.google.com/group/rubyonrails-core?hl=en. > >>> > > >>> > -- > >>> > Anuj DUTTA > >>> > >>> -- > >>> You received this message because you are subscribed to the Google > Groups > >>> "Ruby on Rails: Core" group. > >>> To post to this group, send email to rubyonrails-core@googlegroups.com > . > >>> To unsubscribe from this group, send email to > >>> rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > >>> For more options, visit this group at > >>> http://groups.google.com/group/rubyonrails-core?hl=en. > >>> > >> > >> > >> > >> -- > >> Anuj DUTTA > > > > > > > > -- > > Anuj DUTTA > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Anuj DUTTA -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Martin Gamsjaeger
2010-Jan-28 01:44 UTC
Re: Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Kristian, Hmm, I dunno what I did to github, but currently it doesn''t like to display my README.rdoc for whatever reason. The funny thing is, that it still displays the file when visiting the grandparent of the latest commit at http://github.com/snusnu/datamapper_on_rails3/tree/8a4fda1afddf014ab0d4a4f062974b8cb0ba272a Should this problem persist, clone the repo and make sure you actually READ the README as there are important instructions on how to get the app to actually boot. cheers snusnu On Thu, Jan 28, 2010 at 02:32, Anuj Dutta <dutta.anuj@googlemail.com> wrote:> > > 2010/1/28 Martin Gamsjaeger <gamsnjaga@gmail.com> >> >> Anuj and Kristian, >> >> I just tried >> >> ./script/generate scaffold Profile nick:string >> >> and it worked just fine. I probably also forgot to mention that i have >> a sample app showing datamapper working with rails3 too. >> >> http://github.com/snusnu/datamapper_on_rails3 >> >> cheers >> snusnu > > > It was working fine for me too. Thanks, anyways. > > Anuj > > > >> >> On Wed, Jan 27, 2010 at 20:31, Anuj Dutta <dutta.anuj@googlemail.com> >> wrote: >> > >> > >> > 2010/1/28 Anuj Dutta <dutta.anuj@googlemail.com> >> >> >> >> >> >> 2010/1/28 Kristian Mandrup <kmandrup@gmail.com> >> >>> >> >>> Here is my repo ;) Thanks! >> >>> >> >>> http://github.com/kristianmandrup/datamapper_rails3_demo >> >>> >> >> >> >> >> > >> > >> > Hello, >> > >> > I just created a new Rails3 app and used your gemfile and scaffold >> > data_mapper works fine for me. How are you creating your rails3 project? >> > >> > Anuj >> > >> > >> > >> > >> >> >> >> I will see if I can spot the issue. FYI, you do not need to check the >> >> actual gem directories in just the .gem files (in the cache). >> >> >> >> Anuj >> >> >> >> >> >> >> >>> >> >>> > Hello Kristian, >> >>> > >> >>> > Sorry, I did not know you were doing that already. Right, so can you >> >>> > point >> >>> > me to your repository please and I will run it on my system and >> >>> > debug >> >>> > it. >> >>> > >> >>> > Thanks >> >>> > >> >>> > Anuj >> >>> > >> >>> >> >>> > >> >>> > > > Just saw your repository and I think you should put the >> >>> > > > generator >> >>> > > > files >> >>> > > in a >> >>> > > > directory called "*generators" *or* "rails_generators*". >> >>> > >> >>> > > > And have a look >> >>> > > > athttp://github.com/snusnu/rails3_datamapperfordatamapper >> >>> > > > but I am sure you will get a good idea of what needs to be done. >> >>> > >> >>> > > > Anuj >> >>> > >> >>> > > > -- >> >>> > >> >>> > > > > You received this message because you are subscribed to the >> >>> > > > > Google >> >>> > > Groups >> >>> > > > > "Ruby on Rails: Core" group. >> >>> > > > > To post to this group, send email to >> >>> > > > > rubyonrails-core@googlegroups.com >> >>> > > . >> >>> > > > > To unsubscribe from this group, send email to >> >>> > > > > >> >>> > > > > >> >>> > > > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> >>> > > >> >>> > > >> >>> > > <rubyonrails-core%2Bunsubscribe@googlegroups.com<rubyonrails-core%252Bunsubscribe@googlegroups.com> >> >>> > >> >>> > > > > . >> >>> > > > > For more options, visit this group at >> >>> > > > >http://groups.google.com/group/rubyonrails-core?hl=en. >> >>> > >> >>> > > > -- >> >>> > > > Anuj DUTTA >> >>> > >> >>> > > -- >> >>> > > You received this message because you are subscribed to the Google >> >>> > > Groups >> >>> > > "Ruby on Rails: Core" group. >> >>> > > To post to this group, send email to >> >>> > > rubyonrails-core@googlegroups.com. >> >>> > > To unsubscribe from this group, send email to >> >>> > > >> >>> > > >> >>> > > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> >> >>> > > . >> >>> > > For more options, visit this group at >> >>> > >http://groups.google.com/group/rubyonrails-core?hl=en. >> >>> > >> >>> > -- >> >>> > Anuj DUTTA >> >>> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> >>> Groups >> >>> "Ruby on Rails: Core" group. >> >>> To post to this group, send email to >> >>> rubyonrails-core@googlegroups.com. >> >>> To unsubscribe from this group, send email to >> >>> rubyonrails-core+unsubscribe@googlegroups.com. >> >>> For more options, visit this group at >> >>> http://groups.google.com/group/rubyonrails-core?hl=en. >> >>> >> >> >> >> >> >> >> >> -- >> >> Anuj DUTTA >> > >> > >> > >> > -- >> > Anuj DUTTA >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Ruby on Rails: Core" group. >> > To post to this group, send email to rubyonrails-core@googlegroups.com. >> > To unsubscribe from this group, send email to >> > rubyonrails-core+unsubscribe@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/rubyonrails-core?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To post to this group, send email to rubyonrails-core@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-core+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > > > > -- > Anuj DUTTA > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-28 14:32 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
I never managed to get the datamapper_on_rails3 app to work. I tried to follow the instructions in the readme. I always get this error when I try a scaffold inside the app: kristian-mandrups-macbook-pro:datamapper_on_rails3 kristianconsult$ script/generate scaffold Profile nick:string /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:601:in `to_constant_name'': Anonymous modules have no name to be referenced by (ArgumentError) from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:407:in `qualified_name_for'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:115:in `rescue in const_missing'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ dependencies.rb:105:in `const_missing'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails3_datamapper/lib/rails3_datamapper/ railtie.rb:62:in `block in <class:Railtie>'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: 23:in `instance_exec'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: 23:in `run'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: 61:in `block in run_initializers'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: 60:in `each'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: 60:in `run_initializers'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/application.rb: 63:in `initialize!'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/application.rb: 37:in `method_missing'' from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ config/environment.rb:5:in `<top (required)>'' from script/generate:2:in `require'' from script/generate:2:in `<main>'' .. I created a Gist to be used for installing the app as described in the readme: $ curl -s http://gist.github.com/288787.txt | bash But never mind... I got my Mongo DB generators to work just fine now :) Any idea on how to create a Thor task for creating a complete rails app (using a generator) to override the default rails generator? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kieran P
2010-Jan-29 18:46 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Kristian, Which Ruby version are you on? ruby --version You need at least 1.8.7 or higher. If you''re using 1.8.6, this might be the cause of the issues (Rails 3 drops support for it). Regards Kieran On Jan 29, 3:32 am, Kristian Mandrup <kmand...@gmail.com> wrote:> I never managed to get the datamapper_on_rails3 app to work. I tried > to follow the instructions in the readme. > I always get this error when I try a scaffold inside the app: > kristian-mandrups-macbook-pro:datamapper_on_rails3 kristianconsult$ > script/generate scaffold Profile nick:string > /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:601:in `to_constant_name'': Anonymous modules have no > name to be referenced by (ArgumentError) > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:407:in `qualified_name_for'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:115:in `rescue in const_missing'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/activesupport/lib/active_support/ > dependencies.rb:105:in `const_missing'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails3_datamapper/lib/rails3_datamapper/ > railtie.rb:62:in `block in <class:Railtie>'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: > 23:in `instance_exec'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: > 23:in `run'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: > 61:in `block in run_initializers'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: > 60:in `each'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/initializable.rb: > 60:in `run_initializers'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/application.rb: > 63:in `initialize!'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > vendor/gems/ruby/1.9.1/dirs/rails/railties/lib/rails/application.rb: > 37:in `method_missing'' > from /Users/kristianconsult/my_rails/rails3_apps/datamapper_on_rails3/ > config/environment.rb:5:in `<top (required)>'' > from script/generate:2:in `require'' > from script/generate:2:in `<main>'' > .. > > I created a Gist to be used for installing the app as described in the > readme: > > $ curl -shttp://gist.github.com/288787.txt| bash > > But never mind... I got my Mongo DB generators to work just fine > now :) > > Any idea on how to create a Thor task for creating a complete rails > app (using a generator) to override the default rails generator?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Kristian Mandrup
2010-Jan-30 21:06 UTC
Re: Rails 3 generators for scaffolding models according to selected ORM - how?
Thanks to everyone!!! I have been working a lot on this since this post and I have figured it all out "with a little help from some friend". I''m on Ruby 1.9.1, Rails 3.0 pre. Been creating a lot of nice new Rails 3 generators, currently working on Rails 3 templates!!! I have created a gem "txt_file_mutator" which could be helpful in combination with Rails 3 templates I think ;) I also created a bare-bones Rails 3 application generator, which is much easier to build on, instead of having to remove the index file, README, prototype js files etc. which is often the case... Looking forward to the next official release of Rails 3 :) Cheers! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.