daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## template.rb
  2. def gems(*names)
  3.   names.each do |component|
  4.     unless Gem.available?(component)
  5.       run "gem install #{component}"
  6.       Gem.refresh
  7.       Gem.activate(component)
  8.     end
  9.  
  10.     # try to require it
  11.     begin
  12.       require component.to_s
  13.     rescue LoadError
  14.     end
  15.   end
  16. end
  17.  
  18. gems 'colored'
  19.  
  20. ## command line
  21. rake rails:template LOCATION=../rails-templates/templates/template.rb
  22.  
  23. ##error
  24. ** Invoke rails:template (first_time)
  25. ** Execute rails:template
  26.          run  gem install colored from "."
  27. Successfully installed colored-1.2
  28. 1 gem installed
  29. Installing ri documentation for colored-1.2...
  30. Installing RDoc documentation for colored-1.2...
  31. rake aborted!
  32. Could not find RubyGem colored (>= 0)
  33. /Users/me/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:900:in `report_activate_error'
  34. /Users/me/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in `activate'
RAW Paste Data
Top