# How to use a local ruby gem inside a Sketchup Extension

**URL:** <https://forums.sketchup.com/t/how-to-use-a-local-ruby-gem-inside-a-sketchup-extension/76665>\
**Category:** Ruby API\
**Tags:** import, mac\
**Created:** [September 11, 2018, 5:58pm UTC](https://forums.sketchup.com/t/how-to-use-a-local-ruby-gem-inside-a-sketchup-extension/76665 "2018-09-11T17:58:43Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [September 12, 2018, 1:59pm UTC](https://forums.sketchup.com/t/how-to-use-a-local-ruby-gem-inside-a-sketchup-extension/76665/10 "2018-09-12T13:59:25Z")

</div>

Now you know why SketchUp plugin developers don’t use gems.

Anyway … try just … (_this is what the rubygems modification of `Kernel.require` does._)

```ruby
DPMS_PATH = File.join( ENV['GEM_HOME'], 'gems', 'dpms-client', 'lib' )
$LOAD_PATH << DPMS_PATH
require "dpms-client" # <--<< name of loader file inside "lib" subdir

```

rubygems **ASSUMES** that the loader file inside the “lib” subdir has the same name as the gem itself. Sometimes when it does not weird things happen. (An example is the rubyzip gem which has [or used to have] a loader named `"lib/zip.rb"` instead of `"lib/rubyzip.rb"`.)

---

_[View the full topic](https://forums.sketchup.com/t/how-to-use-a-local-ruby-gem-inside-a-sketchup-extension/76665)._
