#rails のサーバーが立たない
VSコードを利用したrails でローカル環境構築をしたいのですが
rails s
実行後サーバーが立たず以下のエラーが発生してしまいます
###エラー内容
console
1$ rails s 2/Users/xxxxxxx/Desktop/portfolio_rails/price_app/price_app/bin/spring:7:in `<top (required)>': undefined method `specs' for nil:NilClass (NoMethodError) 3 from bin/rails:2:in `load' 4 from bin/rails:2:in `<main>'
どうやらspring
ファイルの7行目がおかしいようで見てみると
spring
1 2#!/usr/bin/env ruby 3if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 4 gem "bundler" 5 require "bundler" 6 7 # Load Spring without loading other gems in the Gemfile, for speed. 8 Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring| 9 Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 10 gem "spring", spring.version 11 require "spring/binstub" 12 rescue Gem::LoadError 13 # Ignore when Spring is not installed. 14 end 15end
全く読めません。。
###試したこと 心あたりがあること
Gemfileの記述は
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '3.0.0' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 6.1.1' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3', '~> 1.4' 10# Use Puma as the app server 11gem 'puma', '~> 5.0' 12# Use SCSS for stylesheets 13gem 'sass-rails', '>= 6' 14# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 15gem 'webpacker', '~> 5.0' 16# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 17gem 'turbolinks', '~> 5' 18# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 19gem 'jbuilder', '~> 2.7' 20# Use Redis adapter to run Action Cable in production 21# gem 'redis', '~> 4.0' 22# Use Active Model has_secure_password 23# gem 'bcrypt', '~> 3.1.7' 24 25# Use Active Storage variant 26# gem 'image_processing', '~> 1.2' 27 28# Reduces boot times through caching; required in config/boot.rb 29gem 'bootsnap', '>= 1.4.4', require: false 30 31group :development, :test do 32 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 33 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 34end 35 36group :development do 37 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 38 gem 'web-console', '>= 4.1.0' 39 # Display performance information such as SQL time and flame graphs for each request in your browser. 40 # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md 41 gem 'rack-mini-profiler', '~> 2.0' 42 gem 'listen', '~> 3.3' 43 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 44 gem 'spring' 45end 46 47group :test do 48 # Adds support for Capybara system testing and selenium driver 49 gem 'capybara', '>= 3.26' 50 gem 'selenium-webdriver' 51 # Easy installation and use of web drivers to run system tests with browsers 52 gem 'webdrivers' 53end 54 55# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 56gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 57
で初期設定から特にいじっていませんが、この状態でbundle install
を実行すると、VSコードターミナル上に以下のエラーが表示され、やはりよくわかりませんでした。
--- TEMPLATE END ---------------------------------------------------------------- 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=Operation+not+permitted+%40+apply2files+-+%2FUsers%2Fkiyomasa%2F.rbenv%2Fversions%2F3.0.0%2Flib%2Fruby%2Fgems%2F3.0.0%2Fgems%2Frails-6.1.1%2FREADME.md&type=Issues If there aren't any reports for this error yet, please create 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
###補足情報 version
ruby -v ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] rails -v Rails 6.1.1
よろしくお願いします。。。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/02/06 08:36
2021/02/06 08:56
2021/02/06 11:39