conradirwin / pry-debundle Goto Github PK
View Code? Open in Web Editor NEWAllows you to use gems not in your Gemfile from Pry.
License: MIT License
Allows you to use gems not in your Gemfile from Pry.
License: MIT License
I ran into the situation described in the README:
Before you rush off to try this, a word of warning: you will waste debugging time because of this. Why? Because running a require 'ampex' inside Pry works, but running a require 'ampex' outside Pry doesn't. "XOMGWTF? Ohhhh! GAH!!" I hear your future self cry as you forget this warning, and then painfully recall it.
So, is there a way to tell when a requested gem is not already part of the bundle and emit a warning when it's been requested? It would have indeed saved a lot of time...
currently fails because source_location
is broken,
Debundling failed: undefined method `preserve_gem_path' for Bundler:Module
When reporting bugs to https://github.com/ConradIrwin/pry-debundle, please include:
* gem version: 2.5.1
* bundler version: 1.12.5
* pry version: 0.10.1
* ruby version: 2.3.1
* ruby engine: ruby
Trying to debundle and load awesome_print
...
~/myapp$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
~/myapp$ bundle exec rails -v
Rails 3.2.14
~/myapp$ gem list | grep awesome_print
awesome_print (1.1.0)
~/myapp$ cat ~/.irbrc
# Try to load Pry instead of IRB
begin
require 'pry'
Pry.start
exit
rescue LoadError => e
warn "Couldn't load pry: #{e}"
end
~/myapp$ cat ~/.pryrc
begin
require 'awesome_print'
AwesomePrint.pry!
rescue LoadError => e
warn "Couldn't load awesome_print: #{e}"
end
Pry.config.prompt_name = File.basename(Dir.pwd)
extend Rails::ConsoleMethods if defined?(Rails) && Rails.env.present?
~/myapp$ bundle list | grep pry
* pry (0.9.12.2)
* pry-debundle (0.7)
~/myapp$ bundle exec rails console
Loading production environment (Rails 3.2.14)
Couldn't load awesome_print: cannot load such file -- awesome_print
[1] 20130903164115(main)> require 'awesome_print'
LoadError: cannot load such file -- awesome_print
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
[2] 20130903164115(main)> Pry.debundle!
=> nil
[3] 20130903164115(main)> require 'awesome_print'
LoadError: cannot load such file -- awesome_print
from /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
Because pry autorequires all plugins, if you install pry-debundle in an environment where bundler is not installed, it raises errors.
currently fails because source_location
is broken,
In the large Rails app I work on, we started getting errors of this form when we upgraded to Ruby 2.5:
Gem::LoadError (ipaddr is not part of the bundle. Add it to your Gemfile.)
We got such errors with a few different gems: csv
, date
, fileutils
, ipaddr
, and webrick
. These are all default gems.
We removed pry-debundle
for other reasons, but removing it turned out to fix this error as well. I tried reproducing the issue with a new Rails app, but I couldn't. I'm creating this issue so that maybe someone who's googling for the error will find it and save some time.
I am totally going to start using this, and suggesting it to people who are desperate to use personal gems for development purposes. Thanks for making this. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.