# How to install import script gem dependencies?

**URL:** <https://meta.discourse.org/t/how-to-install-import-script-gem-dependencies/52229>\
**Category:** Development\
**Created:** [2016 年 10 月 30 日午後 12:51 UTC](https://meta.discourse.org/t/how-to-install-import-script-gem-dependencies/52229 "2016-10-30T12:51:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2016 年 10 月 30 日午後 2:41 UTC](https://meta.discourse.org/t/how-to-install-import-script-gem-dependencies/52229/2 "2016-10-30T14:41:31Z")

</div>

I recommend adding your dependency to the Gemfile and using bundler to install the gems. Run this inside the Docker container:

```bash
cd /var/www/discourse
echo "gem 'my_gem'" >> Gemfile
su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'

```

And you need to run your import script as user `discourse` as well:

```bash
su discourse -c 'bundle exec ruby script/import_scripts/my_import_script.rb

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-install-import-script-gem-dependencies/52229)._
