TypeError (no implicit conversion of Array into String) Rails App on Heroku Using AWS












0















I am following Michael Hart's Ruby on Rails Tutorial and am stuck on Chapter 13. I am unable to post images on my Rails app deployed on Heroku, but images work just fine on the development server. My carrier_wave.rb originally looked like



if Rails.env.production?
CarrierWave.configure do |config|
config.fog_credentials = {
# Configuration for Amazon S3
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
end
end


When my carrier_wave.rb looked like this I was getting an error that looked like this



:reason_phrase => "Forbidden"


After searching around on SO I found this post, and have changed my carrier_wave.rb to look like this



CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines

config.fog_credentials = {
:provider => 'AWS', # required
:s3_access_key_id => ENV['S3_ACCESS_KEY'], # required
:s3_secret_access_key => ENV['S3_SECRET_KEY'], # required
:region => 'us-east-2', # optional, defaults to 'us-east-1'
:host => 's3.example.com', # optional, defaults to nil
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = ENV['S3_Bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end


Now I'm receiving the error



TypeError (no implicit conversion of Array into String)


I don't know if this is closer to working than the original carrier_wave.rb



My IAM user has 'AmazonS3FullAccess' as a permission. I have even tried setting the S3 Bucket to public access, but to no success. Any help or advice would be appreciated.










share|improve this question




















  • 1





    try changing this line config.root = Rails.root.join('tmp').to_s

    – xploshioOn
    Nov 27 '18 at 1:39






  • 1





    Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

    – anothermh
    Nov 27 '18 at 3:52
















0















I am following Michael Hart's Ruby on Rails Tutorial and am stuck on Chapter 13. I am unable to post images on my Rails app deployed on Heroku, but images work just fine on the development server. My carrier_wave.rb originally looked like



if Rails.env.production?
CarrierWave.configure do |config|
config.fog_credentials = {
# Configuration for Amazon S3
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
end
end


When my carrier_wave.rb looked like this I was getting an error that looked like this



:reason_phrase => "Forbidden"


After searching around on SO I found this post, and have changed my carrier_wave.rb to look like this



CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines

config.fog_credentials = {
:provider => 'AWS', # required
:s3_access_key_id => ENV['S3_ACCESS_KEY'], # required
:s3_secret_access_key => ENV['S3_SECRET_KEY'], # required
:region => 'us-east-2', # optional, defaults to 'us-east-1'
:host => 's3.example.com', # optional, defaults to nil
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = ENV['S3_Bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end


Now I'm receiving the error



TypeError (no implicit conversion of Array into String)


I don't know if this is closer to working than the original carrier_wave.rb



My IAM user has 'AmazonS3FullAccess' as a permission. I have even tried setting the S3 Bucket to public access, but to no success. Any help or advice would be appreciated.










share|improve this question




















  • 1





    try changing this line config.root = Rails.root.join('tmp').to_s

    – xploshioOn
    Nov 27 '18 at 1:39






  • 1





    Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

    – anothermh
    Nov 27 '18 at 3:52














0












0








0








I am following Michael Hart's Ruby on Rails Tutorial and am stuck on Chapter 13. I am unable to post images on my Rails app deployed on Heroku, but images work just fine on the development server. My carrier_wave.rb originally looked like



if Rails.env.production?
CarrierWave.configure do |config|
config.fog_credentials = {
# Configuration for Amazon S3
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
end
end


When my carrier_wave.rb looked like this I was getting an error that looked like this



:reason_phrase => "Forbidden"


After searching around on SO I found this post, and have changed my carrier_wave.rb to look like this



CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines

config.fog_credentials = {
:provider => 'AWS', # required
:s3_access_key_id => ENV['S3_ACCESS_KEY'], # required
:s3_secret_access_key => ENV['S3_SECRET_KEY'], # required
:region => 'us-east-2', # optional, defaults to 'us-east-1'
:host => 's3.example.com', # optional, defaults to nil
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = ENV['S3_Bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end


Now I'm receiving the error



TypeError (no implicit conversion of Array into String)


I don't know if this is closer to working than the original carrier_wave.rb



My IAM user has 'AmazonS3FullAccess' as a permission. I have even tried setting the S3 Bucket to public access, but to no success. Any help or advice would be appreciated.










share|improve this question
















I am following Michael Hart's Ruby on Rails Tutorial and am stuck on Chapter 13. I am unable to post images on my Rails app deployed on Heroku, but images work just fine on the development server. My carrier_wave.rb originally looked like



if Rails.env.production?
CarrierWave.configure do |config|
config.fog_credentials = {
# Configuration for Amazon S3
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KEY'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
end
end


When my carrier_wave.rb looked like this I was getting an error that looked like this



:reason_phrase => "Forbidden"


After searching around on SO I found this post, and have changed my carrier_wave.rb to look like this



CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines

config.fog_credentials = {
:provider => 'AWS', # required
:s3_access_key_id => ENV['S3_ACCESS_KEY'], # required
:s3_secret_access_key => ENV['S3_SECRET_KEY'], # required
:region => 'us-east-2', # optional, defaults to 'us-east-1'
:host => 's3.example.com', # optional, defaults to nil
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = ENV['S3_Bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end


Now I'm receiving the error



TypeError (no implicit conversion of Array into String)


I don't know if this is closer to working than the original carrier_wave.rb



My IAM user has 'AmazonS3FullAccess' as a permission. I have even tried setting the S3 Bucket to public access, but to no success. Any help or advice would be appreciated.







ruby-on-rails ruby amazon-web-services heroku railstutorial.org






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 0:23









Sagar Pandya

7,92221933




7,92221933










asked Nov 27 '18 at 0:16









twoshedstwosheds

12




12








  • 1





    try changing this line config.root = Rails.root.join('tmp').to_s

    – xploshioOn
    Nov 27 '18 at 1:39






  • 1





    Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

    – anothermh
    Nov 27 '18 at 3:52














  • 1





    try changing this line config.root = Rails.root.join('tmp').to_s

    – xploshioOn
    Nov 27 '18 at 1:39






  • 1





    Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

    – anothermh
    Nov 27 '18 at 3:52








1




1





try changing this line config.root = Rails.root.join('tmp').to_s

– xploshioOn
Nov 27 '18 at 1:39





try changing this line config.root = Rails.root.join('tmp').to_s

– xploshioOn
Nov 27 '18 at 1:39




1




1





Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

– anothermh
Nov 27 '18 at 3:52





Where's the stacktrace? It should tell you exactly what line is causing the problem. I agree with @xploshioOn that it's likely your config.root line because it returns a Pathname object. But it may be that you need a proc. Check this GitHub issue for more.

– anothermh
Nov 27 '18 at 3:52












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490994%2ftypeerror-no-implicit-conversion-of-array-into-string-rails-app-on-heroku-usin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490994%2ftypeerror-no-implicit-conversion-of-array-into-string-rails-app-on-heroku-usin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)