Skip to content

sadysnaat/minio-carrierwave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoR Pet catalog app using carrierwave and minio Gitter

This project is made with the help of this tutorial

minio_ROR

Example Ruby on Rails App that works with a Minio Server. We will use the carrierwave gem in our rails app to upload objects to a Minio Server. Full code is available here : https://github.com/sadysnaat/minio-carrierwave, released under Apache 2.0 License.

1. Prerequisites

2. Dependencies

3. Install

$ git clone [email protected]:sadysnaat/minio-carrierwave.git
$ cd minio-carrierwave
$ bundle install

4. Set Up Bucket

In this example I have used minio public server and bucket is testbucket.

If you wish to use another bucket, create a new bucket with the following command.

$ mc mb play/new_bucket_name

5. Configure carrierwave defaults to Minio Server

# Set default configuration here, if you wish to use different buckets/servers in
# different environments please set configuration in config/environments/ files
CarrierWave.configure do |config|
  config.fog_provider = 'fog/aws'                        # Mention Fog provider
  config.fog_credentials = {
    provider:              'AWS',                        # required
    aws_access_key_id:     'Q3AM3UQ867SPQQA43P2F',
    aws_secret_access_key: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
    region:                'us-east-1',                  # optional, defaults to 'us-east-1',
                                                         # Please mention other regions if you have changed
                                                         # minio configuration
    host:                  'play.minio.io',              # Provide your host name here, otherwise fog-aws defaults to
                                                         # s3.amazonaws.com
    endpoint:              'https://play.minio.io:9000', # Required, otherwise defauls to nil
    path_style:         true                             # Required
  }
  config.fog_directory  = 'carrierwave'
end

8. Run The App

$ rake db:migrate
$ rails s

Now if you visit http://localhost:3000 you should be able to see the example application.

About

Rails sample app for using minio with carrierwave

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published