dowl icon indicating copy to clipboard operation
dowl copied to clipboard

undefined method `downcase' for nil:NilClass

Open jgeluk opened this issue 13 years ago • 16 comments

/var/lib/gems/1.8/gems/dowl-0.2/bin/../lib/dowl/util.rb:42:in <=>': undefined methoddowncase' for nil:NilClass (NoMethodError) from /var/lib/gems/1.8/gems/dowl-0.2/bin/../lib/dowl/schema.rb:84:in list_classes' from /var/lib/gems/1.8/gems/dowl-0.2/bin/../lib/dowl/schema.rb:84:insort' from /var/lib/gems/1.8/gems/dowl-0.2/bin/../lib/dowl/schema.rb:84:in list_classes' from (erb):38:inrun' from /var/lib/gems/1.8/gems/dowl-0.2/bin/../lib/dowl/generator.rb:19:in run' from /var/lib/gems/1.8/gems/dowl-0.2/bin/dowl:17 from /usr/local/bin/dowl:19:inload' from /usr/local/bin/dowl:19

jgeluk avatar Aug 14 '12 16:08 jgeluk

Hi, just tried to install everything needed and run dowl on my mac, and I'm getting the same issue

/Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/lib/dowl/util.rb:46:in <=>': undefined methoddowncase' for nil:NilClass (NoMethodError) from /Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/lib/dowl/schema.rb:86:in block in list_classes' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/lib/dowl/schema.rb:86:insort' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/lib/dowl/schema.rb:86:in list_classes' from (erb):51:inrun' from /Users/fps/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/erb.rb:849:in eval' from /Users/fps/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/erb.rb:849:inresult' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/lib/dowl/generator.rb:37:in run' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/gems/dowl-0.7/bin/dowl:16:in<top (required)>' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/bin/dowl:23:in load' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/bin/dowl:23:in

' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in eval' from /Users/fps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in
'

Could be my fault, as I had to upgrade ruby (I had 1.8.7 installed, too old), and I'm not used to these things (Basicall, I followed more or less the steps described here: http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/ ) Best, fps

fpservant avatar Aug 22 '13 14:08 fpservant

Hi @fpservant,

You should check out YOWL - our fork of this repo, which contains numerous fixes (including I believe the one regarding the issue you're experiencing) as well as compatibility with modern ruby versions and installation via bundler/gem.

traviskaufman avatar Aug 24 '13 18:08 traviskaufman

Also, for ruby installations I highly recommend using RVM as it provides painless management of multiple ruby installations / gem management (a lot like Python's virtualenv, if you have experience with that sort of thing).

traviskaufman avatar Aug 24 '13 18:08 traviskaufman

Travis,

thanks for your message (I didn't answer earlier, because it had been classified as spam by my mailer :-( )

Well, I had tried to install YOWL, from https://github.com/refinery29/yowl following the instructions (OS X, with Macports). Unfortunately, the shell script to install raptor didn't work with me.

I just tried now from https://github.com/modelfabric/yowl

and I get the same error: raptor_internal.h:855:24: error: curl/types.h: No such file or directory

Making all in src make all-am /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -DLIBRDFA_IN_RAPTOR -I../librdfa -DRAPTOR_INTERNAL=1 -DRAPTOR_V2_EXPERIMENTAL=1 -I/usr/include/libxml2 -I/usr/include/libxml2 -g -O2 -MT raptor_parse.lo -MD -MP -MF .deps/raptor_parse.Tpo -c -o raptor_parse.lo raptor_parse.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -DLIBRDFA_IN_RAPTOR -I../librdfa -DRAPTOR_INTERNAL=1 -DRAPTOR_V2_EXPERIMENTAL=1 -I/usr/include/libxml2 -I/usr/include/libxml2 -g -O2 -MT raptor_parse.lo -MD -MP -MF .deps/raptor_parse.Tpo -c raptor_parse.c -fno-common -DPIC -o .libs/raptor_parse.o In file included from raptor_parse.c:54: raptor_internal.h:855:24: error: curl/types.h: No such file or directory make[2]: *** [raptor_parse.lo] Error 1 make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1 Install failed. See raptorbuild_error.log for more details.

It's probably my fault, as I'm not really used to these kinds of things. Anyway, thank you

fps

Le 24 août 2013 à 20:17, Travis Kaufman [email protected] a écrit :

Also, for ruby installations I highly recommend using RVM as it provides painless management of multiple ruby installations / gem management (a lot like Python's virtualenv, if you have experience with that sort of thing).

— Reply to this email directly or view it on GitHub.

fpservant avatar Aug 27 '13 13:08 fpservant

curl/types.h: No such file or directory

Can you check to make sure you have libcurl installed by running the following command?

$ which curl

If you don't see anything then you need to install libcurl on your system. If you're using macports just do

$ sudo port install curl

And try running the script again. Let me know if this helps.

traviskaufman avatar Aug 27 '13 17:08 traviskaufman

Alternatively if you do find the curl binary you may just have to set your linker path to the directory where the curl header files are located (/opt/local/lib I believe if you installed it via MacPorts)

traviskaufman avatar Aug 27 '13 17:08 traviskaufman

It's not the curl binary that's missing, but the curl types.h file, which is part of the sources of curl. I remember going through all this sh&% before but don't remember exactly how I got through it. Actually thought I had it all documented in the README.md :-).

One thing I do remember is that there's a relevant difference between the last version of Mac OS X and previous versions.

The trouble is all caused by the fact that we depend on libraptor1 via rdf-raptor which is basically no longer supported by installers like Macports etc. As soon as rdf-raptop upgrades to libraptor2 all these nasty build problems will be gone.

jgeluk avatar Aug 27 '13 21:08 jgeluk

What could help is to install the Mac OS X SDK which has curl/types.h

jgeluk avatar Aug 27 '13 21:08 jgeluk

I know, its all way too painful and makes using YOWL on Mac OS X basically impossible for non-geeks

jgeluk avatar Aug 27 '13 21:08 jgeluk

Travis, Jacobus,

I appreciate your help but I'm probably not geek enough to get it working

I have curl installed, I have XCode (4.6.3) installed - but I don't seem to find curl/types.h anywhere on my disk.

What could help is to install the Mac OS X SDK which has curl/types.h

I'm afraid I don't know how to do that

So yes, it's quite difficult to have yowl running on os x when you're not a geek.

Thanks anyway,

fps

Le 27 août 2013 à 19:47, Travis Kaufman [email protected] a écrit :

Alternatively if you do find the curl binary you may just have to set your linker path to the directory where the curl header files are located (/opt/local/lib I believe if you installed it via MacPorts)

— Reply to this email directly or view it on GitHub.

fpservant avatar Aug 27 '13 22:08 fpservant

@fpservant I think its just a simple bug in the code, due to a missing label on a class or the schema. Are you able to share the ontology (or a minimal fragment of it)?

ldodds avatar Aug 28 '13 07:08 ldodds

Hi Leigh,

thanks for the answer. Clearly, there are probably missing labels in
my file. Actually, I was looking for a tool that would allow me to
"interactively" improve the annotations in the ontology by looking at
the resulting HTML.

I've put the file that I have been using here: http://www.semanlink.net/2011/11/co/configurationontology.ttl

Best,

fps

PS: Leigh, I think that we met once briefly, a long time ago: it was
at the jena user conf in Bristol in 2006.

Leigh Dodds [email protected] a écrit :

@fpservant I think its just a simple bug in the code, due to a
missing label on a class or the schema. Are you able to share the
ontology (or a minimal fragment of it)?


Reply to this email directly or view it on GitHub: https://github.com/ldodds/dowl/issues/3#issuecomment-23396436

fpservant avatar Aug 28 '13 09:08 fpservant

@fpservant I think you have to install the Command Line Tools option in Xcode. Go to XCode/Preferences/Downloads/Components. That will install "core command line tools and system headers into system folders".

jgeluk avatar Aug 28 '13 14:08 jgeluk

Jacobus,

nice try, but I had already done that (for other reasons, cf http://jaranto.blogspot.fr/2012/08/os-x-unable-to-execute-clang-no-such.html )

It's very kind of you to try to help me, and it is very serious to try
to understand this problem, but don't worry too much about it: the
fact is that I have been installing a lot of things on my machine
lately (trying to evaluate various tools), and I cannot guarantee that
it is completely in a good state of health - or at least, that my
configuration is not an exotic one.

Thanks again.

Best Regards,

fps

Quoting Jacobus Geluk [email protected]:

@fpservant I think you have to install the Command Line Tools option
in Xcode. Go to XCode/Preferences/Downloads/Components. That will
install "core command line tools and system headers into system
folders".


Reply to this email directly or view it on GitHub: https://github.com/ldodds/dowl/issues/3#issuecomment-23416795

fpservant avatar Aug 28 '13 16:08 fpservant

Aargh... Well, just would like more people to run yowl and actually use it. Thinking of doing a complete rebuild in another language (Scala/Akka/Play) to get rid of the libraptor1 dependency (and a lot of other reasons).

jgeluk avatar Aug 28 '13 16:08 jgeluk

Leigh,

you are right. I changed the end of util.rb to

 def sortLabel()
   x = short_name().downcase();
   #! to have the items wo short name at the end of the list
   if (x.start_with?("http:"))
     x = "zzz" + x
   end
   return x;
 end

 def <=>(other)
   return sortLabel() <=> other.sortLabel()
 end

and things are working (my first lines in ruby! :-)) This is also comre coherent with the way things are displayed in the
page, as it seems that you use the short_name, not the label.

Best,

fps Quoting Leigh Dodds [email protected]:

@fpservant I think its just a simple bug in the code, due to a
missing label on a class or the schema. Are you able to share the
ontology (or a minimal fragment of it)?


Reply to this email directly or view it on GitHub: https://github.com/ldodds/dowl/issues/3#issuecomment-23396436

fpservant avatar Aug 30 '13 11:08 fpservant