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

Launch a rails console in pow environment #123

Open
nielsbuus opened this issue Nov 6, 2015 · 5 comments
Open

Launch a rails console in pow environment #123

nielsbuus opened this issue Nov 6, 2015 · 5 comments

Comments

@nielsbuus
Copy link

I would like to be able to run powder console to launch a rails console with the same environment that my application is running with.

Would you be in favor of a pull request adding that sort of functionality?

@philnash
Copy link
Collaborator

philnash commented Nov 8, 2015

Why would you not use rails console?

@nielsbuus
Copy link
Author

bundle exec rails console does not include .powrc and .powenv.

The easiest way is get around that is to source them both before launching the rails console, but this leaves your current shell dirty which can have side effects ranging from confusing to dangerous.

For instance, if you are working in one project and you set ENABLE_INVOICING=1 and then you switch to another project, it could exhibit undesired behavior because you've forgot that ENABLE_INVOICING is still set. I do realize the likelihood is small, because the pow webserver itself is running independently of your shell.

In addition to side effects, it is also tedious that you have to source before launching a console and if you are changing your .pow* files, then you have to re-source every time you want those changes reflected in a console.

For now, I have written my own bash script and dropped it in my path:

#!/usr/bin/env bash

source .powrc
source .powenv
bundle exec spring stop
bundle exec rails c

I think this functionality is quite useful, so I think it should be part of powder.

@nielsbuus
Copy link
Author

Come to think of it, it would be nice to have a command to run anything in a pow environment. E.g. powder exec rake some:task

@nielsbuus
Copy link
Author

@philnash any update on this?

@philnash
Copy link
Collaborator

philnash commented Dec 1, 2015

This does seem like a pretty good idea, given your explanation. Do you have time to have a go at implementing?

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

2 participants