mwunsch / tumblr

Command line interface and Ruby client for the Tumblr API (v2)
MIT License
282 stars 43 forks source link

Nomethod error #16

Closed samchan closed 12 years ago

samchan commented 13 years ago

I'm getting this when i try and command tumblr after installing the gem:

$ tumblr /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:13:in parameters': undefined methodblank?' for [:title, :body]:Array (NoMethodError) from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:10:in <class:Regular>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:3:inclass:Post' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:2:in <class:Tumblr>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:1:in<top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:184:in <top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr.rb:8:inclass:Tumblr' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr.rb:3:in <top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/bin/tumblr:25:in<top (required)>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/bin/tumblr:19:in load' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/bin/tumblr:19:in

' Air-Jam:~ s$ tumblr --help /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:13:in parameters': undefined methodblank?' for [:title, :body]:Array (NoMethodError) from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:10:in <class:Regular>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:3:inclass:Post' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:2:in <class:Tumblr>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:1:in<top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:184:in <top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr.rb:8:inclass:Tumblr' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/lib/tumblr.rb:3:in <top (required)>' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/s/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/tumblr-rb-1.3.0/bin/tumblr:25:in<top (required)>' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/bin/tumblr:19:in load' from /Users/s/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/bin/tumblr:19:in
'

nchpmn commented 13 years ago

Same Issue:

C:\Users\Nathan\Dropbox\Documents\Writing\Blog Posts>tumblr
C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:13:in `par
ameters': undefined method `blank?' for [:title, :body]:Array (NoMethodError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/
regular.rb:10:in `<class:Regular>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/
regular.rb:3:in `<class:Post>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/
regular.rb:2:in `<class:Tumblr>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/
regular.rb:1:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post.
rb:184:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr.rb:8:
in `<class:Tumblr>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr.rb:3:
in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
 `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/bin/tumblr:25:in
 `<top (required)>'
        from C:/Ruby192/bin/tumblr:19:in `load'
        from C:/Ruby192/bin/tumblr:19:in `<main>'

So, yea, not sure about this error...

This error is immediately after I installed the Gem, so it's not like I broke a setting along the way.

System Specs: Windows 7, Ruby 1.9.2, Gem Version 1.3.0

adamyonk commented 13 years ago

I'm getting this too.

jezkline commented 12 years ago

Me too.

mwunsch commented 12 years ago

Will have to dig a bit deeper into how tumblr makes requires statements. Tumblr requires weary, which requires crack, which requires active_support which provides the blank? method. Are those gems installed on your machine?

nchpmn commented 12 years ago

To try and help, I decided to re-install each of these gems. So, all went well for a while:

C:\Users\Nathan>gem install weary
Successfully installed weary-0.7.2
1 gem installed
Installing ri documentation for weary-0.7.2...
Installing RDoc documentation for weary-0.7.2...

C:\Users\Nathan>gem install crack
Successfully installed crack-0.3.1
1 gem installed
Installing ri documentation for crack-0.3.1...
Installing RDoc documentation for crack-0.3.1...

C:\Users\Nathan>gem install active_support
Fetching: activesupport-3.0.0.gem (100%)
Fetching: active_support-3.0.0.gem (100%)
Successfully installed activesupport-3.0.0
Successfully installed active_support-3.0.0
2 gems installed
Installing ri documentation for activesupport-3.0.0...
Installing ri documentation for active_support-3.0.0...
Installing RDoc documentation for activesupport-3.0.0...
ERROR:  While generating documentation for activesupport-3.0.0
... MESSAGE:   error generating ActiveSupport/Inflector.html: incompatible encodi
ng regexp match (UTF-8 regexp with CP850 string) (Encoding::CompatibilityError)
... RDOC args: --op C:/Ruby192/lib/ruby/gems/1.9.1/doc/activesupport-3.0.0/rdoc l
ib --title activesupport-3.0.0 Documentation --quiet

C:\Users\Nathan>

And then it broke, when installing active_support. Now, I remember that when installing your tumblr-rb gem, it didn't throw this error, so perhaps it was not reporting that it required active_support?

Anyway, the error itself doesn't look painful; it's simply the documentation that's broken, so the gem should work fine (I'll update when I've tested it).

UPDATE 1:

Ok, so I reinstalled the tumblr-rb gem (first checking/proving it wasn't installed).

C:\Users\Nathan\Dropbox\Documents\Writing\Blog Posts>tumblr 009-DSLRFilmmaking.ma
rkdown -q
'tumblr' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Nathan\Dropbox\Documents\Writing\Blog Posts>gem install tumblr-rb
Fetching: tumblr-rb-1.3.0.gem (100%)
Successfully installed tumblr-rb-1.3.0
1 gem installed
Installing ri documentation for tumblr-rb-1.3.0...
Installing RDoc documentation for tumblr-rb-1.3.0...

And then proceeded to try and add a post in the usual method:

C:\Users\Nathan\Dropbox\Documents\Writing\Blog Posts>tumblr 009-DSLRFilmmaking.ma
rkdown -q
C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:13:in `parameters': undefined method `blank?' for [:title, :body]:Array (NoMethodError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:10:in `<class:Regular>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:3:in `<class:Post>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:2:in `<class:Tumblr>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post/regular.rb:1:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:184:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr.rb:8:in `<class:Tumblr>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr.rb:3:in `<top (required)>'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/bin/tumblr:25:in `<top (required)>'
        from C:/Ruby192/bin/tumblr:19:in `load'
        from C:/Ruby192/bin/tumblr:19:in `<main>'

Oops... :S

odacrem commented 12 years ago

I am not sure if crack ever required active_support, but the gem did used to make many extensions to core objects (providing, among other things, the blank? method) e.g.

https://github.com/jnunemaker/crack/blob/d045bbf99e413dd152500e39d940fbf8028b0cdf/lib/crack/core_extensions.rb

but those core extensions were since removed:

https://github.com/jnunemaker/crack/commit/95634857ef58c79d15e37f0648ec3fa4df60e156

Folks will run into this issue if they have crack > 0.2.0 activiated .

mwunsch commented 12 years ago

That would do it, I think an update to the Gemspec is required.

thepleb commented 12 years ago

Is there a gem I can get that has the core extensions baked in then, in the meantime?

Since I have a obvious and desperate need to post to tumblr from the command line. :)

samchan commented 12 years ago

"Since I have a obvious and desperate need to post to tumblr from the command line." <--truth.

nchpmn commented 12 years ago

So... where to from here?

mwunsch commented 12 years ago

Currently working on a rewrite to Weary (https://github.com/mwunsch/weary/tree/rewrite) that removes the dependency on crack.

Short term solution is to gem uninstall crack and gem install crack -v 0.1.7.

Medium term solution is to patch Weary's gemspec.

Long term solution is to wait for the weary rewrite to become stable.

nchpmn commented 12 years ago

Thanks. I wasn't being impatient, just wondering if there was a temporary solution. Thankyou for your work!

conatus commented 12 years ago

Thanks for this quick fix. Enjoying using this!

thepleb commented 12 years ago

Mark, you are a generous and talented individual, and I thank you for your time.

monfresh commented 12 years ago

Thanks for this gem, Mark! I am able to use it just fine via Terminal, but it won't work in TextMate or Keyboard Maestro. I'm using RVM and I created a gemset just for this that contains the following gems:

active_support (3.0.0) activesupport (3.0.0) crack (0.1.7 ruby) highline (1.6.11 ruby) oauth (0.4.5 ruby) rake (0.8.7) tumblr-rb (1.3.0 ruby) weary (0.7.2 ruby)

In TextMate/Keyboard Maestro, I am passing in the following shell command: /Users/orangina/.rvm/gems/ruby-1.9.2-p290@textmate/bin/tumblr -d test.txt --credentials ~/.tumblrlogin

When it runs, it gives me the NoMethodError that started this GitHub issue: /Users/orangina/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/tumblr-rb-1.3.0/lib/tumblr/post.rb:13:in parameters': undefined methodblank?' for [:title, :body]:Array (NoMethodError)

Any ideas how to fix this? Why is it working fine in Terminal but not in TextMate/Keyboard Maestro?

Any help would be greatly appreciated.

chibicode commented 12 years ago

Hi @mwunsch, thanks for the gem - I'm trying to monkey patch code that uses weary now that weary 1.0 is out, but am having some trouble (manually added active_support/core_ext and switched Weary::Base to Weary::Client, but then I ran into a bunch of errors)...

mwunsch commented 12 years ago

@shuuesugi Yeah... Weary 1.0 is not totally backwards compatible, and Tumblr does a bunch of stuff that no longer exists.

Keep an eye on the v2 branch of Tumblr, we're I'm working through upgrading it to Weary 1.0 and to use v2 of the API.

chibicode commented 12 years ago

@mwunsch thanks i will :)