Railsã¢ããªã®éçºã« bundler ã使ãããã«ãªã£ã¦ãgem é¢é£ã§ããããã¨ã¯å°ãªããªã£ããããªæ°ããã¾ãããã ããã®ä»£ããã«ããªã«ãã³ãã³ããå©ãã¨ãã« bundle exec ãã¤ãå¿ãã¦ã¨ã©ã¼ã«ãªããã¨ãæã ãã£ã¦ããããªæã«å°ã ããã©ãããæãã¾ããbundle exec ãçç¥ã§ãããã©ããªã«å¹¸ãã§ããããã
ãããªããã§ã bundle exec ãçç¥ããæ¹æ³ãã¾ã¨ããã®ã§ç´¹ä»ãããã¨æãã¾ãã
rvm ã® gemset ãã¢ããªæ¯ã«ä½ã£ã¦åãæ¿ããæ¹æ³
ä¸è¨ã®ã¨ã³ããªã«è©³ããã¾ã¨ã¾ã£ã¦ãã¾ããããã®éãã«ããã° bundle exec ãã解æ¾ãããã®ã¯ééããªãã®ã§ãããå人çã«ã¯ã¢ããªæ¯ã« gemset ãä½ãã®ã¯å¤§ãããªæãããã¾ãã
bundler-exec.sh ã使ãæ¹æ³
bundler exec ãå¿ è¦ãããªã³ãã³ã(rake ã¨ã rspec ç)ãå®è¡ããã¨ãã«ãbundler ããã¸ã§ã¯ãå ããã®å¼ã³åºãã§ããã°èªå㧠bundle exec ãé ã«ä»ãå ãã bundle-exec.sh ã¨ããååã®ã·ã§ã«ã¹ã¯ãªãããããã¾ããbash ã使ã£ã¦ããã°ä¸è¨ã®ããã«ãã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
curl -L https://github.com/gma/bundler-exec/raw/master/bundler-exec.sh > ~/.bundler-exec.sh echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.bashrc
è¨å®å®äºã®å¤å¥æ¹æ³
ãã¾ãè¨å®ã§ããå ´åãã³ã³ã½ã¼ã«ã§
type ruby
ã¨ããã¨ãã«ã
ruby is an alias for run-with-bundler ruby
ã®ããã«è¡¨ç¤ºããã¾ãã
bundler-exec.sh ã®è©³ç´°
詳ããã¯ã½ã¼ã¹è¦ãã¨ãããã¾ãããbundler-exec.sh ã¯ããããã ruby ã rspec ã¨ãã£ã決ããããã³ãã³ãã«å¯¾ãã¨ã¤ãªã¢ã¹ãå®ç¾©ãã¦ãããããããå®è¡ããã¨ãã«
- bundler ãã¤ã³ã¹ãã¼ã«ããã¦ããã©ãã調ã¹ã
- ã«ã¬ã³ããã£ã¬ã¯ããªããä¸ã«è¾¿ã£ã¦ Gemfile ãããã調ã¹ã
- 1 㨠2 ãçãªã bundle exec ãé ã«ä»ãå ãã¦å®è¡ãã
ã®ãããªæåãããããã«æ¸ããã¦ãã¾ããããã¸ã§ã¯ãæ¯ã®è¨å®ããããæ軽ã§ä¾¿å©ãããªã®ã§ããã°ããããã使ã£ã¦ããããã¨æãã¾ãã
zsh 㧠bundler-exec.sh ã使ã
ç¾å¨ã® bundler-exec.sh 㯠zsh ã ã¨ãã¾ãåãã¾ãããfork ãã¦ä¿®æ£ãã¦ã¿ãã®ã§ zsh 使ãã®æ¹ã¯ãã¡ããã©ããã
curl -L https://raw.github.com/willnet/bundler-exec/master/bundler-exec.sh > ~/.bundler-exec.sh echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.zshrc