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

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

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

Comments

Projects
None yet
3 participants
@botanicus
Contributor

botanicus commented Jun 9, 2011

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

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jun 9, 2011

Member

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

Member

DAddYE commented Jun 9, 2011

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

@botanicus

This comment has been minimized.

Show comment
Hide comment
@botanicus

botanicus Jun 9, 2011

Contributor

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.
Contributor

botanicus commented Jun 9, 2011

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

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Jun 9, 2011

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@botanicus

botanicus Jun 10, 2011

Contributor

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

Contributor

botanicus commented Jun 10, 2011

@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

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Jun 10, 2011

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?

Member

nesquena commented Jun 10, 2011

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

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jun 10, 2011

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@botanicus

botanicus Jun 10, 2011

Contributor

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

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Jun 11, 2011

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

Member

nesquena commented Jun 11, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment