简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM