首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >移动性、脊柱和导轨发生错误

移动性、脊柱和导轨发生错误
EN

Stack Overflow用户
提问于 2022-06-29 00:29:38
回答 1查看 52关注 0票数 0

所以我在为我的公司做一个Rails项目。我想在我的网站上执行Spina。我开始在Gemfile中增加脊柱和移动性

代码语言:javascript
复制
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.1.2'
gem 'rails', '~> 7.0'
gem 'pg', '>= 0.18', '< 2.0'
gem 'spina'
gem 'mobility', '>= 1.2.9'
gem 'rack-mini-profiler', require: false
# For memory profiling
gem 'memory_profiler'
# For call-stack profiling flamegraphs
gem 'flamegraph'
gem 'stackprof'

# Use Json Web Token (JWT) for token based authentication
gem 'jwt'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'

gem 'puma', '~> 5.6'
gem 'sass-rails', '~> 6.0'
gem 'sprockets-rails'
gem 'uglifier', '~> 4.2'
gem 'jbuilder'
gem 'rollbar'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'devise'
gem 'devise-security'
gem 'devise_invitable', '~> 2.0.0'
gem 'rotp'
gem 'active_model_otp'
gem 'rqrcode'
gem 'cancancan'
gem 'webpacker', '6.0.0.rc.6'
gem 'rack-attack'
gem 'rack-cors'
gem 'rswag-api'
gem 'rswag-ui'
gem 'delayed_job_active_record'
gem 'delayed_job_recurring'
gem 'httparty'
gem 'paranoia'
gem 'aws-sdk-s3', require: false
gem 'foreman'
gem 'lograge'
gem 'ffi'
gem 'paper_trail'
gem 'delayed_job_web'
gem 'email_validator'
gem 'ffaker'
gem 'active_link_to'
gem 'interactor-rails', '~> 2.0'
gem 'ajax-datatables-rails'
gem 'draper'
gem 'phonelib'
gem 'wicked_pdf'
gem "wkhtmltopdf-heroku", group: :production
gem 'flipper-active_record'

group :development, :test do
  gem 'rspec-rails', '~> 5.1.0'
  gem 'rswag-specs'
  gem 'factory_bot_rails'
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'rails-controller-testing'
  gem 'dotenv-rails'
  gem 'active_record_doctor'
end

group :development do
  gem "wkhtmltopdf-binary"
  gem 'rubocop'
  gem 'web-console', '>= 3.3.0'
  gem 'listen'
  gem 'spring'
  gem 'spring-watcher-listen'
  gem 'licensed', require: false
  gem 'brakeman'
  gem 'awesome_print'
  gem 'letter_opener'
  gem 'rename', '1.0.8'
end

group :test do
  gem 'simplecov', '0.17.0', require: false
  gem 'capybara'
  gem 'selenium-webdriver'
  gem 'rspec'
  gem 'rspec_junit_formatter'
  gem 'shoulda-matchers'
  gem 'rubocop-rspec'

  # No proper release for Rails 7 yet
  # Thus temporary https://github.com/cucumber/cucumber-rails/issues/523#issuecomment-1008728997
  gem 'cucumber-rails', github: 'mathieujobin/cucumber-rails', branch: 'rails7', require: false
  gem 'database_cleaner'
  gem 'capybara-screenshot'
  gem 'webdrivers', '~> 5.0', require: false
end

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

然后我在我的终端上撞到了rails g spina:install。但不幸的是,它向我展示了以下错误

代码语言:javascript
复制
/home/shubharthak/.rvm/gems/ruby-3.1.2/gems/mobility-1.2.9/lib/mobility.rb:133:in `translations_class': Mobility has not been configured. Configure with Mobility.configure, or assign a translations class with Mobility.translates_with(<class>) (Mobility::Error)
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/mobility-1.2.9/lib/mobility.rb:98:in `translates'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/spina-2.10.0/app/models/spina/resource.rb:9:in `<class:Resource>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/spina-2.10.0/app/models/spina/resource.rb:2:in `<module:Spina>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/spina-2.10.0/app/models/spina/resource.rb:1:in `<main>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/initializable.rb:32:in `instance_exec'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/initializable.rb:32:in `run'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/initializable.rb:61:in `block in run_initializers'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
    from /home/shubharthak/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/initializable.rb:60:in `run_initializers'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/application.rb:372:in `initialize!'
    from /home/shubharthak/Desktop/curve_tomorrow/rails-base/config/environment.rb:5:in `<main>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/application.rb:348:in `require_environment!'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/command/actions.rb:28:in `require_environment!'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/commands/generate/generate_command.rb:21:in `perform'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/command/base.rb:87:in `perform'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/command.rb:48:in `invoke'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/railties-7.0.3/lib/rails/commands.rb:18:in `<main>'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from /home/shubharthak/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    from bin/rails:4:in `<main>'

我正在使用RVM将我的ruby作为3.1.2版本,如果有人知道如何解决它--请帮助我,我真的需要帮助

EN

回答 1

Stack Overflow用户

发布于 2022-06-29 13:00:33

所以我解决了这个问题,他们的自述中有一个问题,我遵循的是,我使用的rails g spina:install命令是用于新项目的。但是对于现有的项目,命令应该是rails spina:install,它将修复这个问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72794519

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档