kyrylo / pry-theme

An easy way to customize Pry colors via theme files
zlib License
171 stars 14 forks source link

Warning: The plugin 'pry-theme' was not found! (gem found but could not be loaded) #11

Closed danielbayerlein closed 12 years ago

danielbayerlein commented 12 years ago

Hi, i have a problems with your plugin in Rails Projects. Any idea? My .pryrc.

$ pry
Warning: The plugin 'pry-theme' was not found! (gem found but could not be loaded)
no such file to load -- pry-theme
ruby-1.9.2-p290 (main):0 > 
kyrylo commented 12 years ago

Hi. Do you use RVM or any other Ruby version manager?

danielbayerlein commented 12 years ago

I use RVM.

kyrylo commented 12 years ago

I don't use Rails, but maybe I can reproduce your problem. Just tell me what do you mean by "in Rails Projects"? How's that differ from regular gem installation?

yorickpeterse commented 12 years ago

@danielbayerlein Post the output of rvm env and gem env.

banister commented 12 years ago

Did you add pry-theme to your Gemfile?

danielbayerlein commented 12 years ago

@banister Nope. I need "pry-theme" in each project Gemfile?

danielbayerlein commented 12 years ago

Same problem pry/pry#317?

banister commented 12 years ago

@danielbayerlein bundler only allows you to use gems you've specified in the Gemfile, so you'd need it in every project's Gemfile if you want to use it.

Maybe pry-debundler could be used to get around this. @conradirwin may explain if there's anything you need to consider when using it.

kyrylo commented 12 years ago

Closing this issue, since the OP lost his interest in the topic (reopen, if not).

danielbayerlein commented 12 years ago

Sorry, I was waiting for response from @ConradIrwin. I think carlhuda/bundler#183 or pry-debundle would solve the problem. I will test it.

kyrylo commented 12 years ago

No worries :) Just let us know about your results.

rking commented 12 years ago

Hrm. That's weird. What gems do you have installed? Have you done anything odd on the pry-theme installation front?

rking commented 12 years ago

Oh. Cool guy rking sees original post but no replies. Ignore me, I'm a nerd.

danielbayerlein commented 12 years ago

Hm, now I'm confused. I have the following added to my .pryrc:

begin
  require 'pry-theme'
  Pry.config.theme = "solarized"
rescue LoadError => e
  warn "[WARN] #{e}"
  puts "$ gem install pry-theme"
end

Now I start "pry".

$ pry
Warning: The plugin 'pry-theme' was not found! (gem found but could not be loaded)
no such file to load -- pry-theme
ruby-1.9.2-p290 (main):0 > pry-theme
Current theme: solarized

You will see a warning, but it works!?

The same with pry-debundle.

kyrylo commented 12 years ago

Try not to require pry-theme (you don't have to, actually).

kyrylo commented 12 years ago

Well, that won't help, I believe :)

danielbayerlein commented 12 years ago

Without require 'pry-theme':

$ pry
Warning: The plugin 'pry-theme' was not found! (gem found but could not be loaded)
no such file to load -- pry-theme
ruby-1.9.2-p290 (main):0 > pry-theme
ruby-1.9.2-p290 (main):0 > exit
NameError: undefined local variable or method `theme' for main:Object
from (pry):1:in `__binding_impl__'
banister commented 12 years ago

@danielbayerlein You get these errors when the gems are in your Gemfile ?

In the case of pry-debundle you still need it in your Gemfile (you just shouldn't need the other plugins in your Gemfile)

danielbayerlein commented 12 years ago

@banister pry-theme is not in my Gemfile. I installed it via gem install pry-theme. I tested pry-debundle with the Personal Installation.

banister commented 12 years ago

@danielbayerlein Please explain more about your setup.

You are trying to use pry-theme without having it added to your Gemfile is that correct?

First please confirm that if you DO have it added to your Gemfile then it works, right?

Now, if you want to use pry-theme but NOT have it added to your Gemfile then you must use pry-debundle, but you still need pry-debundle added to your Gemfile.

danielbayerlein commented 12 years ago

@banister I will test it at the latest on Friday.

danielbayerlein commented 12 years ago

@banister

You are trying to use pry-theme without having it added to your Gemfile is that correct?

Exactly.

First please confirm that if you DO have it added to your Gemfile then it works, right?

Correct.

Now, if you want to use pry-theme but NOT have it added to your Gemfile then you must use pry-debundle, but you still need pry-debundle added to your Gemfile.

I tested pry-debundle and add the Gem to my Gemfile, but it doesn't work correct.

$ pry

ruby-1.9.2-p320 (main):0 > pry-theme
Current theme:

ruby-1.9.2-p320 (main):0 > pry-theme -l
.prytheme doesn't exist
TypeError: can't dup NilClass
from /Users/dbayerlein/.rvm/gems/ruby-1.9.2-p320/gems/pry-theme-0.1.0/lib/pry-theme/commands.rb:244:in `dup'

ruby-1.9.2-p320 (main):0 > pry-theme solarized
Using solarized theme

ruby-1.9.2-p320 (main):0 > pry-theme
Current theme: solarized

Works pry-debundle with the latest pry version?

kyrylo commented 12 years ago

First of all, sorry for the delay. I've kept you waiting for a long time.

Next, I have good news. The bug (and this is a bug) has been fixed. The bug was in pry-debundle. I've sent a patch, so let's pray that @ConradIrwin will accept it (https://github.com/ConradIrwin/pry-debundle/pull/4).

Thank you for your time and participation in discussion.

I'm waiting for your confirmation that pry-theme works for you from now on.

danielbayerlein commented 12 years ago

@kyrylo Great! Your patch (ConradIrwin/pry-debundle#4) is merged, i will test it tomorrow.

danielbayerlein commented 12 years ago

@kyrylo It works! Thanks to all for the help.