启动rails服务器时突然出现这个错误
bundle exec rails s
下面是错误信息
1: from /Users/michelleroos/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require'
/Users/michelleroos/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- faraday/request/multipart (LoadError)
我不确定这是否与我的gem文件有关。我在谷歌上搜索了这个错误,并尝试了其他SO线程中提出的解决方案,但没有任何效果。
我已经试过了:
- 基本上这个线程中的所有内容 该线程
- 这个线程
这是我的gem文件
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.3'
gem 'google-apis-sheets_v4'
gem 'google_drive'
gem 'dotenv-rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2' #5.2.3
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.3'
# 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 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1', require: false #1.1.0
gem 'jquery-rails'
gem 'serialize_json-rails'
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]
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'better_errors'
gem 'binding_of_caller'
end
group :development do
# Access an interactive console on exception pages or by calling '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'
gem 'annotate'
gem 'pry-rails'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
gem 'faker'
gem 'guard-rspec'
gem 'launchy'
gem 'shoulda-matchers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
在我的情况下,我得到了这个错误后修复关于Spring gem的初始错误,然后修复关于Multipart post的错误。经过大量的试验和错误,我决定撤销所有的修复,做一个git reset --hard
,然后从Gemfile
中删除spring
和spring-watcher-listen
宝石,然后通过bundle exec gem uninstall gemname
命令卸载这两个宝石。
然后我发现一个新的错误,当试图运行rails s
,这是关于MySQL
。最后,在修复这些错误后,我能够做一个成功的rails s
。然后我添加了2个宝石,运行bundle
,之后没有错误。