开发者

Mimetype-fu isn't working

I feel like this should be an easy answer but I'm totally stumped.

I've added mimetype_fu to my gemfile and it installed it when I ran bundle install. When I try to use File.mime_type? in my application I g开发者_如何学Goet an error:

NoMethodError: undefined method `mime_type?' for File:Class

In the rails console when I run

gem 'mimetype-fu' 

it returns true

I'm on windows, if that matters

Any ideas?


If you are using Bundler, you can also just add require to the gem line like this.

gem 'mimetype-fu', :require => 'mimetype_fu'


You may need to manually require it inside your rails app. You can do this by adding an file to config/initializers/ if you want it to be available globally.

EDIT | Also, you did restart the rails server, right? ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜