Nomethod error
samchan opened this issue · 18 comments
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 method
blank?' 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:in
class: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:in
require'
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:in
require'
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:in
class: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:in
require'
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 method
blank?' 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:in
class: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:in
require'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:in
require'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:in
class: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:in
require'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
'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
I'm getting this too.
Me too.
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?
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
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.
but those core extensions were since removed:
Folks will run into this issue if they have crack > 0.2.0 activiated .
That would do it, I think an update to the Gemspec is required.
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. :)
"Since I have a obvious and desperate need to post to tumblr from the command line." <--truth.
So... where to from here?
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.
Thanks. I wasn't being impatient, just wondering if there was a temporary solution. Thankyou for your work!
Thanks for this quick fix. Enjoying using this!
Mark, you are a generous and talented individual, and I thank you for your time.
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 method
blank?' 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.
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)...