前提・実現したいこと
勉強を初めて一ヶ月ほどの初心者です。
前回のエラー(https://teratail.com/questions/243709)を個人的に調べていた時、VSCodeのターミナルのシェルを変更したのか、ずっとrails sでローカルサーバーが立ち上がっていたのに、以下のエラ〜メッセージが発生しました。
発生している問題・エラーメッセージ
terminal
1=> Booting Puma 2=> Rails 5.2.4.1 application starting in development 3=> Run `rails server -h` for more startup options 4Exiting 5Traceback (most recent call last): 6 123: from bin/rails:3:in `<main>' 7 122: from bin/rails:3:in `load' 8中略 9/Users/○○○○○○/Desktop/blog/app/models/user.rb:7:in `name': wrong number of arguments (given 2, expected 0) (ArgumentError)
該当のソースコード
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.1' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.4', '>= 5.2.4.1' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3' 10# Use Puma as the app server 11gem 'puma', '~> 3.11' 12# Use SCSS for stylesheets 13# gem 'sass-rails', '~> 5.0' 14# Use Uglifier as compressor for JavaScript assets 15gem 'uglifier', '>= 1.3.0' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'mini_racer', platforms: :ruby 18 19# Use CoffeeScript for .coffee assets and views 20gem 'coffee-rails', '~> 4.2' 21# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 22gem 'turbolinks', '~> 5' 23# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 24gem 'jbuilder', '~> 2.5' 25# Use Redis adapter to run Action Cable in production 26# gem 'redis', '~> 4.0' 27# Use ActiveModel has_secure_password 28# gem 'bcrypt', '~> 3.1.7' 29 30# Use ActiveStorage variant 31# gem 'mini_magick', '~> 4.8' 32 33# Use Capistrano for deployment 34# gem 'capistrano-rails', group: :development 35 36gem 'bootstrap-sass' 37gem 'sass-rails' 38 39gem 'devise' 40 41# Reduces boot times through caching; required in config/boot.rb 42gem 'bootsnap', '>= 1.1.0', require: false 43 44group :development, :test do 45 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 46 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 47end 48 49group :development do 50 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 51 gem 'web-console', '>= 3.3.0' 52 gem 'listen', '>= 3.0.5', '< 3.2' 53 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 54 gem 'spring' 55 gem 'spring-watcher-listen', '~> 2.0.0' 56end 57 58group :test do 59 # Adds support for Capybara system testing and selenium driver 60 gem 'capybara', '>= 2.15' 61 gem 'selenium-webdriver' 62 # Easy installation and use of chromedriver to run system tests with Chrome 63 gem 'chromedriver-helper' 64end 65 66# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 67gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
User
1class User < ApplicationRecord 2 # Include default devise modules. Others available are: 3 # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable 4 devise :database_authenticatable, :registerable, 5 :recoverable, :rememberable, :validatable 6 7 has_one name :profile, dependent: :destroy 8end
試したこと
・少し前にも同じことが起こったのですが、その時には.bash_profileに何かを追記すればいいというのをネットで見つけ、それを追記したら動き出したのを覚えています(調べたサイト、何を追記したのかは失念しました。すいません・・・)
・bundle installをしました。
・railsが何箇所にダウンロードをされているのを確認はしました(どうやって見たのかなど、方法は失念しました。すいません)
補足情報(FW/ツールのバージョンなど)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin19]
Rails 6.0.2.1
VSCodeのターミナルで、bashを使用していました。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー