require 'mime/types' Fails

115 views
Skip to first unread message

Matt Todd

unread,
Mar 4, 2008, 11:42:49 PM3/4/08
to GitNub
As recorder at http://pastie.org/161609 nub will complain about
missing dependency 'mime/types'.

I have installed the gem mime-types and also recompiled and copied to
the destination folders, but this did not resolve the error and the
same error occurs.

Justin Palmer

unread,
Mar 5, 2008, 12:00:06 AM3/5/08
to GitNub
Hmm, lets try a few things here.

1. Can you require 'mime/types' from IRB?
2. Have you built ruby from source and/or have gems in two different
locations?
What do you get when you run `gem which mime/types`
I get: /Library/Ruby/Gems/1.8/gems/mime-types-1.15/lib/mime/
types.rb

I'll likely end up bundling mime/types so there are no external
dependencies, but it'd be nice to determine why
it can't find mime/types.


On Mar 4, 8:42 pm, Matt Todd <chiol...@gmail.com> wrote:
> As recorder athttp://pastie.org/161609nub will complain about

Matt Todd

unread,
Mar 5, 2008, 12:13:36 AM3/5/08
to GitNub
Hey Justin,

> 1. Can you require 'mime/types' from IRB?

ruby -rubygems -e 'require "mime/types"'
This returns no error, though if I do not require rubygems it fails
(as well it should).


> What do you get when you run `gem which mime/types`
> I get: /Library/Ruby/Gems/1.8/gems/mime-types-1.15/lib/mime/
> types.rb

Ares:~ mtodd$ gem which mime/types
(checking gem mime-types-1.15 for mime/types)
/opt/local/lib/ruby/gems/1.8/gems/mime-types-1.15/lib/mime/types.rb


> 2. Have you built ruby from source and/or have gems in two different
> locations?

I don't really remember if I hand-rolled my Ruby install or if I am
using the Leopard pre-bundled one. I think the latter, since the error
messages include some framework files in some of the Apple standard
library locations, but I don't know for sure.

> I'll likely end up bundling mime/types so there are no external
> dependencies, but it'd be nice to determine why
> it can't find mime/types.

I agree! :)


Matt Todd

Justin Palmer

unread,
Mar 5, 2008, 12:26:50 AM3/5/08
to GitNub
Hmm, I bet it has to do with your gems being in a nonstandard location
(although this is fairly common). I think this is just an issue with
RubyCocoa in general. If you have two ruby's on your system it has a
hard time determining which one to use unless you compile it from
source.

You might try installing/moving/symlinking the gem to /Library/Ruby/
Gems/1.8/gems/mime-types-1.15. I'm
fairly confident that would fix the problem as a short term solution.

Matt Todd

unread,
Mar 5, 2008, 12:58:41 AM3/5/08
to GitNub
Unfortunately, this doesn't solve the issue, either. I now have an
exact copy in /Library/Ruby/Gems/1.8/gems/mime-types-1.15/ and it
gives the same error.

As an experiment, I added both paths to the PATH environment variable
in my bash profile, but this had no affect.

:(

Matt Todd

Justin Palmer

unread,
Mar 5, 2008, 2:19:50 PM3/5/08
to GitNub
I'm coming up short here. The final solution would be to add the gem
to the XCode project and
include it in ApplicationController and recompile like grit is now.

alloy

unread,
Mar 5, 2008, 2:34:07 PM3/5/08
to GitNub
Hi Matt,

Are you using the default leopard RubyCocoa?
If so it won't work with your ruby installation.

If you want to use your won ruby you'll need to install RubyCocoa form
source,
see http://rubycocoa.sourceforge.net/FAQ for more info.

Otherwise do: $ /usr/bin/gem install mime-types which should make sure
that the
ruby/gem installation that RubyCocoa is using will have the correct
gem

Cheers,
Eloy

Matt Todd

unread,
Mar 6, 2008, 12:50:31 AM3/6/08
to GitNub
Well, I installed RubyCocoa right before compiling, but only the DMG,
not from source. Is there a significant difference?

Matt Todd

Eloy Duran

unread,
Mar 6, 2008, 4:01:47 AM3/6/08
to git...@googlegroups.com
Yes the same applies.
If you want to use a custom ruby you will have to install RubyCocoa
from source.

Eloy

Matt Aimonetti

unread,
Mar 8, 2008, 12:45:10 AM3/8/08
to GitNub
I have the same problem as Matt Todd. I'm using Ruby compiled by
macports.
Packaging the gem would probably be the best option.

-Matt

Matt Aimonetti

unread,
Mar 8, 2008, 1:36:44 AM3/8/08
to GitNub
I added the mimetype gem to my fork so it builds without dependencies.

Feel free to pull from my fork.

-Matt

Matt Aimonetti

unread,
Mar 8, 2008, 1:38:14 AM3/8/08
to GitNub
wow, I'm tired, here is my repo: http://github.com/matta/gitnub/tree/master

git clone git://github.com/matta/gitnub.git

-Matt

Justin Palmer

unread,
Mar 8, 2008, 11:19:25 AM3/8/08
to git...@googlegroups.com
Hey Matt,

Looking at your changes and I'm not seeing the mime-type gem.  Am I missing something?

Justin Palmer

unread,
Mar 8, 2008, 4:32:31 PM3/8/08
to GitNub
I've just bundled mime-types and pushed some new features. Let me
know if this works for you.
http://github.com/Caged/gitnub/tree/master


On Mar 8, 8:19 am, "Justin Palmer" <encyteme...@gmail.com> wrote:
> Hey Matt,
> Looking at your changes and I'm not seeing the mime-type gem.  Am I missing
> something?
>
> On Fri, Mar 7, 2008 at 10:38 PM, Matt Aimonetti <mattAimone...@gmail.com>
> Justin Palmerhttp://alternateidea.com|http://lighthouseapp.com|http://activereload.net|http://warehouseapp.com

Matt Todd

unread,
Mar 9, 2008, 3:14:13 AM3/9/08
to GitNub
Compiling it from master works, hooray!

Sidenote, tried compiling RubyCocoa from source and got some errors
(and was following the directions on the site). Will need to look into
that, just thought I'd mention that.

Matt Todd



On Mar 8, 5:32 pm, Justin Palmer <encyteme...@gmail.com> wrote:
> I've just bundled mime-types and pushed some new features.  Let me
> know if this works for you.http://github.com/Caged/gitnub/tree/master

Matt Aimonetti

unread,
Mar 9, 2008, 1:59:32 PM3/9/08
to GitNub
Justin,

No you didn't miss anything, I was too tired and only push the
modified files and forgot to add the new files :p

Sorry about that,

-Matt

On Mar 8, 9:19 am, "Justin Palmer" <encyteme...@gmail.com> wrote:
> Hey Matt,
> Looking at your changes and I'm not seeing the mime-type gem.  Am I missing
> something?
>
> On Fri, Mar 7, 2008 at 10:38 PM, Matt Aimonetti <mattAimone...@gmail.com>
> Justin Palmerhttp://alternateidea.com|http://lighthouseapp.com|http://activereload.net|http://warehouseapp.com
Reply all
Reply to author
Forward
0 new messages