dockerの環境構築をしています。
しかし、下記のエラーにハマってなかなか解決できていない状況です。
railsの設定で何かしらエラーが起きている原因た管理者権限が付与されていない?のが原因だと思いますが、原因がわかる方いますでしょうか?
bundler: failed to load command: rails (/usr/local/bundle/bin/rails) web_1 | Errno::EPERM: Operation not permitted @ rb_sysopen - /aaaa/Gemfile web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:528:in `read' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:528:in `contents' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:558:in `to_s' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:12:in `message' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:12:in `rescue in <top (required)>' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:9:in `<top (required)>' web_1 | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
Dockerfile
1FROM ruby:2.5.1 2RUN apt-get update && apt-get install -y \ 3 build-essential \ 4 nodejs 5WORKDIR /aaaa 6COPY Gemfile Gemfile.lock /aaaa/ 7RUN gem install bundler && bundle install 8COPY . /aaaa 9
docker
1version: '3' 2 3volumes: 4 mysql-data: 5 6services: 7 db: 8 image: mysql:5.7 9 environment: 10 MYSQL_USER: root 11 cap_add: 12 - SYS_ADMIN 13 security_opt: 14 - seccomp:unconfined 15 ports: 16 - "4306:3306" 17 volumes: 18 - ./db/mysql/volumes:/var/lib/mysql 19 20 web: 21 build: . 22 command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" 23 ports: 24 - '3000:3000' 25 volumes: 26 - '.:/aaaa' 27 tty: true 28 stdin_open: true 29 depends_on: 30 - db
database.yml
1# MySQL. Versions 5.1.10 and up are supported. 2# 3# Install the MySQL driver 4# gem install mysql2 5# 6# Ensure the MySQL gem is defined in your Gemfile 7# gem 'mysql2' 8# 9# And be sure to use new-style password hashing: 10# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html 11# 12default: &default 13 adapter: mysql2 14 encoding: utf8 15 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 16 username: root 17 password: 18 host: db 19 # socket: /tmp/mysql.sock 20 21development: 22 <<: *default 23 database: KStargram_development 24 25# Warning: The database defined as "test" will be erased and 26# re-generated from your development database when you run "rake". 27# Do not set this db to the same as development or production. 28test: 29 <<: *default 30 database: KStargram_test 31 32# As with config/secrets.yml, you never want to store sensitive information, 33# like your database password, in your source code. If your source code is 34# ever seen by anyone, they now have access to your database. 35# 36# Instead, provide the password as a unix environment variable when you boot 37# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 38# for a full rundown on how to provide these environment variables in a 39# production deployment. 40# 41# On Heroku and other platform providers, you may have a full connection URL 42# available as an environment variable. For example: 43# 44# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" 45# 46# You can use this database configuration with: 47# 48# production: 49# url: <%= ENV['DATABASE_URL'] %> 50# 51production: 52 # <<: *default 53 adapter: postgresql 54 encoding: unicode 55 database: aaaa_production 56 username: aaaa 57 password: <%= ENV['AAAA_DATABASE_PASSWORD'] %> 58 pool: 5 59
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。