I have a custom ruby gem that relies heavily on bundle console
. Nothing special or fancy, just an interactive console with the set of gems defined by the Gemfile included. We use the console a lot during development.
Currently when I run the command, I receive the following deprecation message:
[DEPRECATED] bundle console will be replaced by
bin/console
generated bybundle gem <name>
Digging around in the bundler docs I found the following explanation:
- The
bundle console
will be removed and replaced withbin/console
.Over time we found
bundle console
hard to maintain because every user would want to add her own specific tweaks to it. In order to ease maintenance and reduce bikeshedding discussions, we're removing thebundle console
command in favor of abin/console
script created bybundle gem
on gem generation that users can tweak to their needs.
Can anyone with knowledge provide a more detailed explanation? This gem currently does not have a bin
directory. I'm happy to make one, I'm just not sure what should be in the file. Running bundle gem
as described in the note above raises an error (as expected).
This is the file that is generated at bin/console
:
#!/usr/bin/env ruby
require "bundler/setup"
require "(your gem name here)"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start(__FILE__)
You can see the template in the rubygems GitHub repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With