When I'm in a directory with Gemfile, padrino-gen doesn't work (nor even padrino-gen --help), it just keeps telling me:
Could not find gem 'shoulda (>= 2.10.3, runtime)' in any of the gem sources listed in your Gemfile.
Can u try with latest edge? I fixed a similar problem, now our bins handle bundler correctly.
Sorry man, not quite yet:
Could not find gem 'webrat (= 0.5.1, runtime)' in any of the gem sources listed in your Gemfile.
Weird not seen anything like this. Even if you do bundle exec padrino-gen do you still get this error?
bundle exec padrino-gen
@nesquena: no, it's the oposite problem: it DOES load the Gemfile when I don't want to. Imagine you want to create a project, so you run padrino-gen, but it fails because it tries to load Gemfile from the local directory. Gotcha?
Ah I am with you now, hmm that is kind of annoying. This is almost certainly because we auto-load the Gemfile if it exists in our binaries now to avoid having to bundle exec all the time. I can see that being a problem if you want to simply create a project, it probably shouldn't try to load the bundler environment. @daddye what do you think?
Generally when u create a project u are in a directory where there isn't a Gemfile so in this case we use system wide gems.
Then if you generate another thing like model, admin etc so you have a Gemfile and we load correctly this has bundle exec do.
We can improve a bit this checking for example if we have .components other that Gemfile we are in a padrino root. Can be done for u? @botanicus, @nesquena and @achiu?
"Generally when u create a project u are in a directory where there isn't a Gemfile so in this case we use system wide gems."
That's true, but only "generally". In 10% cases it's not the case (typically quick testing "what will happen if I generate project with ...").
"We can improve a bit this checking for example if we have .components other that Gemfile we are in a padrino root."
Too complicated IMHO, what about not load it for project generation and --help, load it otherwise (you never generate controller outside of a project).
I would say checking for .components is a good idea since without it the generators won't actually work anyways...or equally effective would be to simply not load it only for 'project' generation. I am actually ok either way
Fixed issue #571, don't handle Gemfile if we are outside a Padrino pr…