Open aaronmallen opened 1 month ago
Additionally this is adding a gem called "name" to the collection which doesn't exist and causes steep to fail
I'm not 100% sure because I haven't implemented nor used the local source, but a few ideas:
gem
line in your Gemfile
, you may not need additional source in rbs_collection.yaml
rbs collection update
, not adding the local source@pocke might help you if you continue having the problem.
I expect the rbs collection
to load the gem's RBS for a gem with the path:
option from the RubyGems source instead of the local
source.
So, it should work with the following configuration.
# rbs_collection.yaml
sources:
- type: git
name: ruby/gem_rbs_collection
remote: https://github.com/ruby/gem_rbs_collection.git
revision: main
repo_dir: gems
But I haven't tested the path:
option with rbs collection
. If it does not work well, please tell me 🙏
The local source is designed to specify not a sig/
directory of a gem but an RBS collection repository. For example, if you want to use local
source, you need to put a collection directory like the following:
$ tree
.
└── my_rbs_collection
└── gems
└── domainic-dev
└── 0.1
└── domainic-dev.rbs
However you do not need the collection repository because rbs collection
should load RBS files from domainic-dev/sig/
directory without any configuration. It's a bug if it does not work.
Idk for sure but this might not work as expected for mono repos with multiple gems
Hmm, I couldn't reproduce this problem on my local. The following commands works for me.
$ bundle init
$ $EDITOR Gemfile
$ cat Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
gem "rbs", require: false
gem 'my_gem', path: './my_gem'
$ bundle gem my_gem
$ $EDITOR my_gem/my_gem.gemspec # To remove TODOs
$ (cd my_gem && bundle install)
$ bundle install
$ bundle exec rbs collection init
$ bundle exec rbs collection install
W, [2024-10-10T09:55:47.295514 #36800] WARN -- rbs: Cannot find
domainic-dev-0.1.0gem. Using incorrect Bundler context? (src/domainic/domainic/Gemfile.lock)
This error indicates that your environment has two or more Gemfile.lock
s and you execute the rbs collection
command with unexpected Gemfile.lock
.
The rbs collection
command expects to work with the Bundler context, including gems for which you want to install RBS files. So, when you bundle exec rbs collection install
, the Gemfile.lock
for the bundle exec
should include domainic-dev
gem.
But this error indicates that the Gemfile.lock
does not include it.
Could you confirm it?
Hmm, I couldn't reproduce this problem on my local. The following commands works for me.
$ bundle init $ $EDITOR Gemfile $ cat Gemfile # frozen_string_literal: true source "https://rubygems.org" gem "rbs", require: false gem 'my_gem', path: './my_gem' $ bundle gem my_gem $ $EDITOR my_gem/my_gem.gemspec # To remove TODOs $ (cd my_gem && bundle install) $ bundle install $ bundle exec rbs collection init $ bundle exec rbs collection install
W, [2024-10-10T09:55:47.295514 #36800] WARN -- rbs: Cannot find
domainic-dev-0.1.0gem. Using incorrect Bundler context? (src/domainic/domainic/Gemfile.lock)
This error indicates that your environment has two or more
Gemfile.lock
s and you execute therbs collection
command with unexpectedGemfile.lock
. Therbs collection
command expects to work with the Bundler context, including gems for which you want to install RBS files. So, when youbundle exec rbs collection install
, theGemfile.lock
for thebundle exec
should includedomainic-dev
gem. But this error indicates that theGemfile.lock
does not include it. Could you confirm it?
Don't know how I missed this I apologize for the delay: https://github.com/domainic/domainic/blob/main/Gemfile.lock#L12
In my gemspec I have:
In my rbs_collection.yaml I have:
and when I run
bundle exec rbs collection install
I get:This may be an issue of documentation or it may be a bug. I'm not sure I fully understand the expectation of the
sources
property of therbs_collection.yaml