This project is made with the help of this tutorial
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.
$ git clone git@github.com:sadysnaat/minio-carrierwave.git
$ cd minio-carrierwave
$ bundle install
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
# 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
$ rake db:migrate
$ rails s
Now if you visit http://localhost:3000 you should be able to see the example application.