rails db:由于参数数目错误,安装程序中止

uqzxnwby  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(228)

所以我现在正在努力开发这个项目(https://open.appacademy.io/learn/full-stack-online/javascript/ajax-twitter)但是在执行“rails db:setup”时,我遇到了错误“rails中止!”!,argumenterror:参数数目错误(给定3个,应为2个)”

rails db:setup --trace 

**Invoke db:setup (first_time)
**Invoke db:schema:load_if_ruby (first_time)
**Invoke db:create (first_time)
**Invoke db:load_config (first_time)
**Invoke environment (first_time)
**Execute environment

rails aborted!
ArgumentError: wrong number of arguments (given 3, expected 2)
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/static.rb:111:in `initialize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:37:in `new'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:37:in `build'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:101:in `block in build'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:101:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:101:in `inject'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/actionpack-5.2.6/lib/action_dispatch/middleware/stack.rb:101:in `build'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/engine.rb:510:in `block in app'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/engine.rb:506:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/engine.rb:506:in `app'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/initializable.rb:32:in `instance_exec'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/initializable.rb:32:in `run'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in `each'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in `call'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
/Users/eduardomeza/.rvm/rubies/ruby-3.0.1/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/initializable.rb:60:in `run_initializers'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/application.rb:361:in `initialize!'
/Users/eduardomeza/Downloads/skeleton 13/config/environment.rb:5:in `<main>'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/application.rb:337:in `require_environment!'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/command.rb:48:in `invoke'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/railties-5.2.6/lib/rails/commands.rb:18:in `<main>'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eduardomeza/.rvm/gems/ruby-3.0.1/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config => environment

我目前正在使用:
“ruby 3.0.1p64(2021-04-05修订版0fb782ee38)[arm64-darwin20]”
“轨道5.2.6”
“”postgress.app“”
sqlite版本3.32.3 2020-06-18 14:16:19
文件是:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'bootsnap', require: false

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.2'

# Use postgresql as the database for Active Record

gem 'pg', '>= 1.0.0'

# Use Puma as the app server

gem 'puma', '~> 3.7'

# Use SCSS for stylesheets

gem 'sass-rails', '~> 5.0'

# Use Uglifier as compressor for JavaScript assets

gem 'uglifier', '>= 1.3.0'

# See https://github.com/rails/execjs#readme for more supported runtimes

# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views

gem 'coffee-rails', '~> 4.2'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jbuilder', '~> 2.5'

# Use Redis adapter to run Action Cable in production

# gem 'redis', '~> 3.0'

# Use ActiveModel has_secure_password

gem 'bcrypt', '~> 3.1.7'

gem 'jquery-rails'

# Use Capistrano for deployment

# gem 'capistrano-rails', group: :development

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]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  gem 'pry-rails'
  gem 'better_errors'
  gem 'binding_of_caller'
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

project附带一个框架和许多默认文件(您可以单击上面的链接并检查文件,因为它是一个打开的项目)。我所做的唯一不同之处是,我没有像他们建议的那样使用ruby 2.5.1,但我怀疑这可能是问题所在。对rails来说非常陌生,所以如果有人能给我指引正确的方向,我会非常感激。非常感谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题