前提・実現したいこと
ここに質問の内容を詳しく書いてください。
ruby on rails の環境構築についてご質問させていただきます。
■■な機能を実装中に以下のエラーメッセージが発生しました。
rails new RailsAppを入力した時に発生している問題・エラーメッセージ
--- ERROR REPORT TEMPLATE ------------------------------------------------------- # Error Report ## Questions Please fill out answers to these questions, it'll help us figure out why things are going wrong. - **What did you do?** I ran the command `/Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/exe/bundle install` - **What did you expect to happen?** I expected Bundler to... - **What happened instead?** Instead, what happened was... - **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?** I tried... - **Have you read our issues document, https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/ISSUES.md?** ## Backtrace Errno::EACCES: Permission denied @ rb_sysopen - /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rails-6.1.4.1/README.md /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:424:in `initialize' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:424:in `open' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:424:in `block (2 levels) in extract_tar_gz' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:65:in `each' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:405:in `block in extract_tar_gz' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:534:in `block in open_tar_gz' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:531:in `wrap' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:531:in `open_tar_gz' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:404:in `extract_tar_gz' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:384:in `block (2 levels) in extract_files' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package/tar_reader.rb:65:in `each' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:381:in `block in extract_files' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package/file_source.rb:29:in `open' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package/file_source.rb:29:in `with_read_io' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/package.rb:378:in `extract_files' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/installer.rb:837:in `extract_files' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/rubygems_gem_installer.rb:24:in `install' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/source/rubygems.rb:199:in `install' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/installer/gem_installer.rb:54:in `install' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/installer/parallel_installer.rb:186:in `do_install' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/worker.rb:62:in `apply_func' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/worker.rb:57:in `block in process_queue' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/worker.rb:54:in `loop' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/worker.rb:54:in `process_queue' /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.27/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads' ## Environment Bundler 2.2.27 Platforms ruby, x86_64-darwin-19 Ruby 3.0.2p107 (2021-07-07 revision 0db68f023372b634603c74fca94588b457be084c) [x86_64-darwin19] Full Path /Users/shojihiroto/.rbenv/versions/3.0.2/bin/ruby Config Dir /Users/shojihiroto/.rbenv/versions/3.0.2/etc RubyGems 3.2.22 Gem Home /Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0 Gem Path /Users/shojihiroto/.gem/ruby/3.0.0:/Users/shojihiroto/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0 User Home /Users/shojihiroto User Path /Users/shojihiroto/.gem/ruby/3.0.0 Bin Dir /Users/shojihiroto/.rbenv/versions/3.0.2/bin OpenSSL Compiled OpenSSL 1.1.1l 24 Aug 2021 Loaded OpenSSL 1.1.1l 24 Aug 2021 Cert File /Users/shojihiroto/.rbenv/versions/3.0.2/openssl/ssl/cert.pem Cert Dir /Users/shojihiroto/.rbenv/versions/3.0.2/openssl/ssl/certs Tools Git 2.24.3 (Apple Git-128) RVM not installed rbenv rbenv 1.1.2 chruby not installed ## Bundler Build Metadata Built At 2021-09-03 Git SHA b737e1c930 Released Version true ## Bundler settings ignore_messages Set via BUNDLE_IGNORE_MESSAGES: true ## Gemfile ### Gemfile ruby source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.0.2' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem 'rails', '~> 6.1.4', '>= 6.1.4.1' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.4' # Use Puma as the app server gem 'puma', '~> 5.0' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 5.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.4', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 4.1.0' # Display performance information such as SQL time and flame graphs for each request in your browser. # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md gem 'rack-mini-profiler', '~> 2.0' gem 'listen', '~> 3.3' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 3.26' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] ###Gemfile.lock <No /Users/shojihiroto/Desktop/RailsApp/Gemfile.lock found> Unfortunately, an unexpected error occurred, and Bundler cannot continue. First, try this link to see if there are any existing issue reports for this error: https://github.com/rubygems/rubygems/search?q=Permission+denied+%40+rb_sysopen+-+%2FUsers%2Fshojihiroto%2F.rbenv%2Fversions%2F3.0.2%2Flib%2Fruby%2Fgems%2F3.0.0%2Fgems%2Frails-6.1.4.1%2FREADME.md&type=Issues If there aren't any reports for this error yet, please copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md run bundle binstubs bundler Could not find gem 'rails (~> 6.1.4, >= 6.1.4.1)' in locally installed gems. rails webpacker:install Could not find gem 'rails (~> 6.1.4, >= 6.1.4.1)' in locally installed gems. Run `bundle install` to install missing gems.
試したこと
上記エラーより、以下2つを実行しました。
①上記指定のURLにアクセス
https://github.com/rubygems/rubygems/search?q=Permission+denied+%40+rb_sysopen+-+%2FUsers%2Fshojihiroto%2F.rbenv%2Fversions%2F3.0.2%2Flib%2Fruby%2Fgems%2F3.0.0%2Fgems%2Frails-6.1.4.1%2FREADME.md&type=Issues
→特にエラーは発見されませんでした。
②bundle binstubs bundlerを実行
→以下のエラーが出ました。
エラー:Could not locate Gemfile or .bundle/ directory
ちなみに、ファイルには、
Gemfileは、テキストファイルのみでディレクトリーは存在しないように思えます。
.bundleは、存在しません。
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
ruby →2.6
rails→6.0.2
ここにより詳細な情報を記載してください。
あなたの回答
tips
プレビュー