Skip to content
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
Closed

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

botanicus opened this issue Jun 9, 2011 · 8 comments
Milestone

Comments

@botanicus
Copy link
Contributor

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
Copy link
Member

DAddYE commented Jun 9, 2011

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

@botanicus
Copy link
Contributor Author

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
Copy link
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
Copy link
Contributor Author

@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
Copy link
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
Copy link
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
Copy link
Contributor Author

"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
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants