Skip to content

Don't load ./Gemfile when creating a new project #571

Closed
botanicus opened this Issue Jun 9, 2011 · 8 comments

3 participants

@botanicus

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.
@DAddYE
Padrino Framework member
DAddYE commented Jun 9, 2011

Can u try with latest edge? I fixed a similar problem, now our bins handle bundler correctly.

@botanicus

Sorry man, not quite yet:

padrino-gen --help
Could not find gem 'webrat (= 0.5.1, runtime)' in any of the gem sources listed in your Gemfile.
@nesquena
Padrino Framework member
nesquena commented Jun 9, 2011

Weird not seen anything like this. Even if you do bundle exec padrino-gen do you still get this error?

@botanicus

@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?

@nesquena
Padrino Framework member

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?

@DAddYE
Padrino Framework member
DAddYE commented Jun 10, 2011

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?

@botanicus

"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).

@nesquena
Padrino Framework member

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

@DAddYE DAddYE closed this Jun 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.