How to add a gem dependency and bundle install
Is it possible to add a gem dependency to a Rails 3 app programmatically through ruby code?
EDIT
I'm trying to achieve that when I launch a rake task or a ruby script my rails app becomes a sass rails app.
I have a bunch of file that needs to be copied and after that I'd like to add:开发者_运维技巧
gem 'sass'
to my Gemfile and run bundle install automatically.
Today's railscasts features Guard!
One of the guard extensions is guard-bundler which has this code that can achieve what I need.
https://github.com/guard/guard-bundler/blob/master/lib/guard/bundler.rb
I thought that there was a way to perform similar tasks with the Bundler
class.
精彩评论