{"action":"created","issue":{"url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1551","labels_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1551/labels{/name}","comments_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1551/comments","events_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1551/events","html_url":"https://github.com/carrierwaveuploader/carrierwave/issues/1551","id":55109921,"number":1551,"title":"Undefined method `mount_uploaders'","user":{"login":"molayab","id":1709983,"avatar_url":"https://avatars.githubusercontent.com/u/1709983?v=3","gravatar_id":"","url":"https://api.github.com/users/molayab","html_url":"https://github.com/molayab","followers_url":"https://api.github.com/users/molayab/followers","following_url":"https://api.github.com/users/molayab/following{/other_user}","gists_url":"https://api.github.com/users/molayab/gists{/gist_id}","starred_url":"https://api.github.com/users/molayab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molayab/subscriptions","organizations_url":"https://api.github.com/users/molayab/orgs","repos_url":"https://api.github.com/users/molayab/repos","events_url":"https://api.github.com/users/molayab/events{/privacy}","received_events_url":"https://api.github.com/users/molayab/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-22T03:20:44Z","updated_at":"2015-01-22T22:35:48Z","closed_at":"2015-01-22T22:26:51Z","body":"Undefined method `mount_uploaders'.\r\n\r\nRails console:\r\n-------\r\n\r\nrequire 'carrierwave' -> return false\r\nrequire 'carrierwave/orm/activerecord' -> return false\r\n\r\n```\r\n2.1.3 :003 > u = Event.new\r\nNoMethodError: undefined method `mount_uploaders' for Event (call 'Event.connection' to establish a connection):Class\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/dynamic_matchers.rb:26:in `method_missing'\r\n\tfrom /Users/molayab/Developer/GoOut 2.0/app/models/event.rb:2:in `<class:Event>'\r\n\tfrom /Users/molayab/Developer/GoOut 2.0/app/models/event.rb:1:in `<top (required)>'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `load'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:457:in `block in load_file'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:647:in `new_constants_in'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:456:in `load_file'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:354:in `require_or_load'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:494:in `load_missing_constant'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:184:in `const_missing'\r\n\tfrom (irb):3\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /Users/molayab/Developer/GoOut 2.0/bin/rails:8:in `<top (required)>'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /Users/molayab/.rvm/gems/ruby-2.1.3/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /Users/molayab/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'\r\n\tfrom /Users/molayab/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'\r\n\tfrom -e:1:in `<main>'2.1.3 :004 > \r\n```\r\n\r\nI have installed:\r\n============\r\n carrierwave 0.10.0\r\n mini_magick 4.0.2\r\n\r\nApplication.rb\r\n------------------\r\n\r\n```\r\nrequire File.expand_path('../boot', __FILE__)\r\n\r\nrequire 'rails/all'\r\nrequire 'carrierwave'\r\nrequire 'carrierwave/orm/activerecord'\r\n\r\n# Require the gems listed in Gemfile, including any gems\r\n# you've limited to :test, :development, or :production.\r\nBundler.require(*Rails.groups)\r\n\r\nmodule GoOut20\r\n  class Application < Rails::Application\r\n    # Settings in config/environments/* take precedence over those specified here.\r\n    # Application configuration should go into files in config/initializers\r\n    # -- all .rb files in that directory are automatically loaded.\r\n\r\n    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.\r\n    # Run \"rake -D time\" for a list of tasks for finding time zone names. Default is UTC.\r\n    config.time_zone = 'Bogota'\r\n\r\n    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.\r\n    config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]\r\n    config.i18n.default_locale = :es\r\n\r\n    config.assets.version = '1.0'\r\n    config.assets.paths << Rails.root.join(\"app\", \"assets\", \"fonts\")\r\n  end\r\nend\r\n```\r\n\r\nevent.rb (model)\r\n----------------------\r\n\r\n```\r\nclass Event < ActiveRecord::Base\r\n  mount_uploaders :images, ImageUploader\r\n\r\n  belongs_to :location\r\n  belongs_to :city\r\n  belongs_to :category\r\nend\r\n```\r\n\r\nimage_uploader.rb (CarrierWave)\r\n--------------------------------------------\r\n\r\n```\r\n# encoding: utf-8\r\n\r\nclass ImageUploader < CarrierWave::Uploader::Base\r\n\r\n  # Include RMagick or MiniMagick support:\r\n  # include CarrierWave::RMagick\r\n  include CarrierWave::MiniMagick\r\n\r\n  # Choose what kind of storage to use for this uploader:\r\n  storage :file\r\n\r\n  process convert: 'png'\r\n\r\n  # Override the directory where uploaded files will be stored.\r\n  # This is a sensible default for uploaders that are meant to be mounted:\r\n  def store_dir\r\n    \"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"\r\n  end\r\n\r\n  # Provide a default URL as a default if there hasn't been a file uploaded:\r\n  # def default_url\r\n  #   # For Rails 3.1+ asset pipeline compatibility:\r\n  #   # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\r\n  #\r\n  #   \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\r\n  # end\r\n\r\n  # Process files as they are uploaded:\r\n  # process :scale => [200, 300]\r\n  #\r\n  # def scale(width, height)\r\n  #   # do something\r\n  # end\r\n\r\n  # Create different versions of your uploaded files:\r\n  # version :thumb do\r\n  #   process :resize_to_fit => [50, 50]\r\n  # end\r\n\r\n  version :thumb do\r\n    #process :resize_to_fill => [180,180]\r\n    process resize_to_fill: [180, 180]\r\n  end\r\n\r\n  version :small_thumb do\r\n    process resize_to_fit: [89, 98]\r\n  end\r\n\r\n  version :large_thumb do\r\n    process resize_to_fit: [280, 116]\r\n  end\r\n\r\n  version :largest_thumb do\r\n    process resize_to_fit: [560, 232]\r\n  end\r\n\r\n  # Add a white list of extensions which are allowed to be uploaded.\r\n  # For images you might use something like this:\r\n  def extension_white_list\r\n    %w(jpg jpeg gif png)\r\n  end\r\n\r\n  # Override the filename of the uploaded files:\r\n  # Avoid using model.id or version_name here, see uploader/store.rb for details.\r\n  def filename\r\n    \"#{SecureRandom.uuid}.#{file.extension}\" if original_filename.present?\r\n  end\r\n\r\nend\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/comments/71113396","html_url":"https://github.com/carrierwaveuploader/carrierwave/issues/1551#issuecomment-71113396","issue_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1551","id":71113396,"user":{"login":"bensie","id":4595,"avatar_url":"https://avatars.githubusercontent.com/u/4595?v=3","gravatar_id":"","url":"https://api.github.com/users/bensie","html_url":"https://github.com/bensie","followers_url":"https://api.github.com/users/bensie/followers","following_url":"https://api.github.com/users/bensie/following{/other_user}","gists_url":"https://api.github.com/users/bensie/gists{/gist_id}","starred_url":"https://api.github.com/users/bensie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensie/subscriptions","organizations_url":"https://api.github.com/users/bensie/orgs","repos_url":"https://api.github.com/users/bensie/repos","events_url":"https://api.github.com/users/bensie/events{/privacy}","received_events_url":"https://api.github.com/users/bensie/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T22:35:48Z","updated_at":"2015-01-22T22:35:48Z","body":"Until then, I recommend using the readme from the version you're using:\r\nhttps://github.com/carrierwaveuploader/carrierwave/tree/v0.10.0"}}