0
응용 프로그램이 기록 된 루비 2.3.1/레일 5AWS 오류 레일에 서버 시작까지 레일 4
내가이 오류를 수신하고 레일을 서버를 시작하려고 :
Shawns-MacBook-Pro:PatrolVault-SaaS shawnwilson$ rails s
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/aws-sdk-core/plugins/regional_endpoint.rb:34:in `after_initialize': missing region; use :region option or export region name to ENV['AWS_REGION'] (Aws::Errors::MissingRegionError)
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/seahorse/client/base.rb:84:in `block in after_initialize'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/seahorse/client/base.rb:83:in `each'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/seahorse/client/base.rb:83:in `after_initialize'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/seahorse/client/base.rb:21:in `initialize'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-2.6.12/lib/seahorse/client/base.rb:105:in `new'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-resources-2.6.12/lib/aws-sdk-resources/resource.rb:169:in `extract_client'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/aws-sdk-resources-2.6.12/lib/aws-sdk-resources/resource.rb:15:in `initialize'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/shrine-2.4.1/lib/shrine/storage/s3.rb:155:in `new'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/shrine-2.4.1/lib/shrine/storage/s3.rb:155:in `initialize'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config/initializers/shrine.rb:11:in `new'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config/initializers/shrine.rb:11:in `<top (required)>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/engine.rb:647:in `load_config_initializer'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `each'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:30:in `run'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `each'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /Users/shawnwilson/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/application.rb:352:in `initialize!'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config/environment.rb:5:in `<top (required)>'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config.ru:3:in `require_relative'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config.ru:3:in `block in <main>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config.ru:in `new'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/config.ru:in `<main>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/server.rb:59:in `app'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/server.rb:77:in `start'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/bin/rails:9:in `require'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/bin/rails:9:in `<top (required)>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `load'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/rails.rb:28:in `call'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client/command.rb:7:in `call'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/client.rb:30:in `run'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/bin/spring:49:in `<top (required)>'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `load'
from /Users/shawnwilson/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/binstub.rb:31:in `<top (required)>'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/bin/spring:14:in `require'
from /Users/shawnwilson/Desktop/PatrolVault/PatrolVault-SaaS/bin/spring:14:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I가 시도를 shrine.rb를 region:
에서 s3_region
으로 변경하십시오. 그러나 아무런 도움이되지 않습니다 .. 어떻게이 오류를 해결할 수 있습니까?
figaro를 사용하여 로컬 ENV 변수를 관리하고 있습니다.
모든 지원을 제공해 주시면 대단히 감사하겠습니다.
이
는 자격 증명require "shrine/storage/s3"
s3_options = {
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
region: ENV['AWS_REGION'],
bucket: ENV['AWS_BUCKET']
}
Shrine.storages = {
cache: Shrine::Storage::S3.new(prefix: "cache", **s3_options),
store: Shrine::Storage::S3.new(prefix: "new", **s3_options),
}
Shrine.plugin :activerecord
Shrine.plugin :direct_upload
Shrine.plugin :restore_cached_data
보통 내가하는 일은 ENV 변수가 무엇인가 (.env가 없거나 내 편이나 누락) 누락 된 경우, ENV.fetch ("...")'를 사용하여 이 ENV 변수가없는 명시 적 오류. –