Giter VIP home page Giter VIP logo

avatari's Introduction

Hello, I'm Jonas

I am a doctoral researcher in computer science at ETH Zürich.

Feel free to reach out to me through [email protected].

avatari's People

Contributors

jonhue avatar

Watchers

 avatar  avatar  avatar

avatari's Issues

Undefined method `extension_whitelist'

I'm trying to set the avatar of a user in a seed file (as per the instructions at carrierwave's github readme):

File.open(Rails.root.join('app', 'assets', 'images', 'Jurgen.png')) do |f|
  user.avatar = f
end

user.save!

I'm getting the following error:

NoMethodError: undefined method `extension_whitelist' for nil:NilClass
/app/vendor/bundle/ruby/2.4.0/gems/avatari-2.0.1/app/uploaders/avatari/avatar_uploader.rb:11:in `extension_whitelist'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/extension_whitelist.rb:40:in `check_extension_whitelist!'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/callbacks.rb:14:in `block in with_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/callbacks.rb:14:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/callbacks.rb:14:in `with_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/cache.rb:137:in `cache!'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/mounter.rb:44:in `block in cache'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/mounter.rb:42:in `map'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/mounter.rb:42:in `cache'
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/mount.rb:146:in `avatar='
/app/vendor/bundle/ruby/2.4.0/gems/carrierwave-1.2.2/lib/carrierwave/orm/activerecord.rb:70:in `avatar='

Using Rails 5.2.0.beta2.

Also, I found I had to add the carrierwave gem in my Gemfile before the avatari gem because of an uninitialized constant error, similar to #2.

Railtie fails to load causing rails to fail at startup

Rails (5.2.0.beta2) project fails to load because of constant error.

/app/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.1.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:49:in `block in load_missing_constant': uninitialized constant Avatari::Railtie::Mozaic (NameError)

This occurs because the Mozaic constant isn't required prior to calling the initializer 'avatari.mozaic' block in the Railtie. To get around this I added the mozaic gem to my Gemfile before the avatari gem.

Ideally however, you could add a require statement in the Railtie and maybe prefix the constant with a ::.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.