Skip to content

Instantly share code, notes, and snippets.

@beneggett
Last active February 17, 2017 22:55
Show Gist options
  • Save beneggett/6893866 to your computer and use it in GitHub Desktop.
Save beneggett/6893866 to your computer and use it in GitHub Desktop.
.powenv
# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi
# load environment of current project ruby
if
[ -n "${rvm_path:-}" ] &&
[ -x "${rvm_path:-}/bin/rvm" ] &&
rvm_project_environment=`"${rvm_path:-}/bin/rvm" . do rvm env --path 2>/dev/null` &&
[ -n "${rvm_project_environment:-}" ] &&
[ -s "${rvm_project_environment:-}" ]
then
echo "RVM loading: ${rvm_project_environment:-}"
\. "${rvm_project_environment:-}"
else
echo "RVM project not found at: $PWD"
fi

Installing Pow

Install powder Gem

There is a gem called powder used to manage pow

rvm gemset use global
gem install powder

Install Pow

powder install

You can run powder to see a list of all powder options

We want Pow to work with our RVM gemsets (.ruby-version & .ruby-gemset)

Create a .powenv file in our home directory ~/ and copy in this code. We'll use this as a template for all of our projects

Copy our .powenv into each project, so pow reads it when we load it

Create a symbolic link from our project directory

ln -s ~/.powenv .powenv

We could create an alias in our ~/.zshrc file that does this for us, as follows:

alias powlink='echo "ln -s ~/.powenv .powenv" && ln -s ~/.powenv .powenv'

Linking it up

We can link our application using

powder link

and open it with

powder open

Common commands:

powder open # opens up the server in your browser
powder restart # restart your server
powder open --xip # open up the xip.io version

other commands available by typing powder

@beneggett
Copy link
Author

Goes in home directory: ~/.powenv

@beneggett
Copy link
Author

Symlink this to your project home directory:

ln -s ~/.powenv .powenv

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