How to do bundle install using specific rvm gemset from git hook post-receive?
So, I’m trying to implement a heroku-like deployment without using capistrano.
To check and install gems I’m trying to use git hook and put the following commands in /hooks/post-receive:
bundle check || bundle install
But when I run
git push I get:
- Problems finding ruby, rails, git after bungled PostgreSQL install
- Ruby version change on heroku push
- How to solve “/usr/bin/env: ruby_executable_hooks: No such file or directory”?
- Can't update RVM - “fatal: Unable to find remote helper for 'http'”
- Error while installing RVM on ubuntu 11.04. Seems to be git clone's error
- Why is bundler not installing gems stored in get repo properly?
remote: hooks/post-receive: line 20: bundle: command not found.
I understand that a hook probably launches commands from the wrong environment and somehow I have to switch rvm environment from hook. I tried to use rvm use 1.8.7@rails3 in post-receive but it didn’t help. Any ideas?
2 Solutions collect form web for “How to do bundle install using specific rvm gemset from git hook post-receive?”
You might just have to make sure you source the user’s environment at the top of the hook, for example:
$ source $HOME/.bash_profile # single user RVM setup $ source /etc/profile # multi user RVM setup
Maybe this gist will help you!
Kudos to the gist owner!