“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay...”

Rob Lacey (contact@robl.me)
Senior Software Engineer, Brighton, UK

How to vendor a gem

I’ve got a really annoying DEPRECATION WARNING. It appears the wck gem is spitting out errors and it’s no longer being updated. All I want to do is calm down the errors. The styles are all still helpful.

DEPRECATION WARNING: Extra .css in SCSS file is unnecessary. Rename /Users/cex/.rvm/gems/ruby-2.2.2@epic-invite/gems/wck-0.0.5/app/assets/stylesheets/wck.css.scss to /Users/cex/.rvm/gems/ruby-2.2.2@epic-invite/gems/wck-0.0.5/app/assets/stylesheets/wck.scss. (called from _app_views_home_index_html_haml___3330030305515264653_70130897119780 at /Users/cex/repos/epic-invite/app/views/home/index.html.haml:9)

Best course of action is to vendor the gem. So All I need to do is unpack it into my application and fix the issue.

New-MacBook-Pro:epic-invite cex$ gem unpack wck --target=vendor/gems/
Unpacked gem: '/Users/cex/repos/epic-invite/vendor/gems/wck-0.0.5'

Gemfile

...
gem 'high_voltage', '~> 3.0.0'
gem 'wck', path: 'vendor/gems/wck-0.0.5'
gem 'cancancan'
...

And bundle install to install from that path.

New-MacBook-Pro:epic-invite cex$ bundle install
...
Using valid_email 0.0.11
Using wck 0.0.5 from source at `vendor/gems/wck-0.0.5`
Using whenever 0.9.4
....

The solution is to just rename the file, and satisfying to avoid seeing so many errors.

mv wck.css.scss wck.scss