0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gemの開発directoryにできたgemsファイルを消すときに困った話.

Last updated at Posted at 2020-12-22

!Mac OS X-10.13.3 !ruby-2.7.0p0

はじめに

卒業研究でqiita_orgというgemを作っていると, 'gems directoryが含まれているよ'とissueがきたので,これを消そうとしました.このときに困ったことをメモしておきます.

困ったことについて.

今回の件の始まり.

mensfeldさんより以下のようなissueが来た.

While reviewing the changes for this lib, I noticed, that the vendor/gems directory is being included.

Is this needed? Usually, it's added by mistake and causes:
a) confusion
b) problems when tracking changes
c) makes gem much bigger than it could be

ref: https://github.com/yamatoken/qiita_org/tree/master/gems/ruby/2.7.0

If the presence of vendor data is valid I would love the reasoning. Thanks!

rubyもgem開発も初心者でこんなこと考えたこともなかったし,いい学びを得れたので,いつの間にかできていたgems directoryは消してしまおうとしました.

自分の行ったこと.

消した後,念のため確認でqiita_orgのpostコマンドを試して見ると以下のようになった.

Bundler could not find compatible versions for gem "command_line":
  In Gemfile:
    qiita_org was resolved to 0.1.35, which depends on
      command_line (> 2.0.0)

Could not find gem 'command_line (> 2.0.0)', which is required by gem 'qiita_org', in any of the sources.

とりあえず, 'bundle update'をして見ると,消したはずのgems directoryが復活していた.

原因について

rmで消しても復活するし,.gitignoreでgemsをGithubに上げないようにしても勝手に上がってる.

原因は,.bundle/configの中にあった.

.bundle/config
BUNDLE_PATH: "gems"

こんなものがあったのでgems directoryが生成されていた.

これを消して解決.


  • source ~/Github/yamatoken/bundler_path.org
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?