# Discourse がプラグインで指定された gem を見つけられない

**URL:** <https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968>\
**Category:** Development\
**Created:** [2022 年 3 月 3 日午後 3:21 UTC](https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968 "2022-03-03T15:21:29Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)\
**Post date:** [2022 年 3 月 14 日午前 7:43 UTC](https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968/13 "2022-03-14T07:43:58Z")

</div>

この問題は、discourse の最新の `tests-passed` および `stable` ブランチで修正されました。

> <https://github.com/discourse/discourse/commit/6b8c622762571a9012cb1805f04b6b2593526021>
>
> when bundler is loaded, it sets the \`RUBYOPT\` environment variable to setup bund…ler. However, it was causing weird errors like the following when we try to install
> custom plugin gems into a specific directory.
> 
> \`\`\`
> /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:214:in \`rescue in load\_spec\_files': https://github.com/discourse/mail.git is not yet checked out. Run \`bundle install\` first. (Bundler::GitError)
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:210:in \`load\_spec\_files'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/path.rb:107:in \`local\_specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:178:in \`specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/lazy\_specification.rb:88:in \`\_\_materialize\_\_'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:75:in \`block in materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:72:in \`map!'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:72:in \`materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:468:in \`materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:190:in \`specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:238:in \`specs\_for'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/runtime.rb:18:in \`setup'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler.rb:151:in \`setup'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in \`block in \<top (required)\>'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:136:in \`with\_level'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:88:in \`silence'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in \`\<top (required)\>'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site\_ruby/2.7.0/rubygems/core\_ext/kernel\_require.rb:85:in \`require'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site\_ruby/2.7.0/rubygems/core\_ext/kernel\_require.rb:85:in \`require'
> \`\`\`

> <https://github.com/discourse/discourse/pull/16176>
>
> when bundler is loaded, it sets the \`RUBYOPT\` environment variable to setup bund…ler. However, it was causing weird errors like the following when we try to install
> custom plugin gems into a specific directory.
> 
> \`\`\`
> /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:214:in \`rescue in load\_spec\_files': https://github.com/discourse/mail.git is not yet checked out. Run \`bundle install\` first. (Bundler::GitError)
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:210:in \`load\_spec\_files'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/path.rb:107:in \`local\_specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:178:in \`specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/lazy\_specification.rb:88:in \`\_\_materialize\_\_'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:75:in \`block in materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:72:in \`map!'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec\_set.rb:72:in \`materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:468:in \`materialize'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:190:in \`specs'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:238:in \`specs\_for'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/runtime.rb:18:in \`setup'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler.rb:151:in \`setup'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in \`block in \<top (required)\>'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:136:in \`with\_level'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:88:in \`silence'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in \`\<top (required)\>'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site\_ruby/2.7.0/rubygems/core\_ext/kernel\_require.rb:85:in \`require'
> from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site\_ruby/2.7.0/rubygems/core\_ext/kernel\_require.rb:85:in \`require'
> \`\`\`

---

_[View the full topic](https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968)._
