I am trying to deploy a rails app to elastic beanstalk but getting an error.
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: [Instance: i-053f6b1dfef0f156b] Command failed on instance. Return code: 1 Output: (TRUNCATED)...arrierwave.rb:2:in `block in <top (required)>'
/var/app/ondeck/config/initializers/carrierwave.rb:1:in `<top (required)>'
/var/app/ondeck/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace).
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-053f6b1dfef0f156b'. Aborting the operation.
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
Don't know why I am getting this Carrierwave error. I have that file to work with S3 to upload photos.
carrierwave.rb
CarrierWave.configure do |config|
config.fog_credentials = {
provider: "AWS",
aws_access_key_id: ENV["AWS_ACCESS_KEY_ID"],
aws_secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"]
}
config.fog_directory = ENV["AWS_S3_BUCKET"]
end
environment.rb
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
Here is the log:
EDIT HERE:
ArgumentError: Missing required arguments: aws_access_key_id, aws_secret_access_key
/var/app/ondeck/config/initializers/carrierwave.rb:2:in `block in <top (required)>'
/var/app/ondeck/config/initializers/carrierwave.rb:1:in `<top (required)>'
/var/app/ondeck/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => environment
EDIT2 my part of the gem file;
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
and I created the RDS with postgresql. database.yml file;
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: <%= ENV['RDS_DB_NAME'] %>#db/production.sqlite3
username: <%= ENV['RDS_USERNAME'] %>
password: <%= ENV['RDS_PASSWORD'] %>
host: <%= ENV['RDS_HOSTNAME'] %>
port: <%= ENV['RDS_PORT'] %>
getting an error of ;
ERROR: [Instance: i-053f6b1dfef0f156b] Command failed on instance. Return code: 1 Output: (TRUNCATED)...sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
Gem::LoadError: sqlite3 is not part of the bundle. Add it to Gemfile.
why should I add gem sqlite3?, I have it already in development and should use in production. That is how Heroku works. I thought the same for elastic beanstalk

/var/log/eb-activity.log. What does it say?using console or EB CLI. Or, just google it.