lorint / brick

Auto-generate models, views, controllers, and routes in a Rails app based on database structure
Other
286 stars 8 forks source link

Issue in generate brick:models #5

Closed selamar closed 1 year ago

selamar commented 1 year ago

Hi lorint, trying to generate models I get

/usr/local/bundle/gems/brick-1.0.131/lib/generators/brick/models_generator.rb:65:in block (2 levels) in brick_models': undefined methodexists?' for Dir:Class (NoMethodError)

      Dir.mkdir(dir) unless Dir.exists?(dir)
                               ^^^^^^^^

Did you mean? exist? from /usr/local/bundle/gems/brick-1.0.131/lib/generators/brick/models_generator.rb:63:in each' from /usr/local/bundle/gems/brick-1.0.131/lib/generators/brick/models_generator.rb:63:inblock in brick_models' from /usr/local/bundle/gems/brick-1.0.131/lib/generators/brick/models_generator.rb:52:in each' from /usr/local/bundle/gems/brick-1.0.131/lib/generators/brick/models_generator.rb:52:inbrick_models' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:134:in block in invoke_all' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:134:ineach' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:134:in map' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:134:ininvoke_all' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/group.rb:232:in dispatch' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:instart' from /usr/local/bundle/gems/railties-7.0.4.3/lib/rails/generators.rb:263:in invoke' from /usr/local/bundle/gems/railties-7.0.4.3/lib/rails/commands/generate/generate_command.rb:26:inperform' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command' from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from /usr/local/bundle/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:inperform' from /usr/local/bundle/gems/railties-7.0.4.3/lib/rails/command.rb:48:in invoke' from /usr/local/bundle/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in

' from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in require' from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:inrequire' from /usr/local/bundle/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' from bin/rails:4:in
'

I found some reference online to use File.exists instead.

Bye Sergio

lorint commented 1 year ago

Thanks @selamar for this find!

Did you mean? exist?

Why yes, Ruby you smart one ... I did :)

Now corrected in v1.0.133.

selamar commented 1 year ago

Thanks!

Il giorno lun 24 apr 2023 alle ore 16:22 lorint @.***> ha scritto:

Closed #5 https://github.com/lorint/brick/issues/5 as completed.

— Reply to this email directly, view it on GitHub https://github.com/lorint/brick/issues/5#event-9082112513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWDSTUDVVKXYJVLYC72XADXC2EB3ANCNFSM6AAAAAAXJRC3VA . You are receiving this because you were mentioned.Message ID: @.***>