If you write payjp in Gemfile and do rails s after bundle installs, a lot of characters will be listed.
cannot load such file -- mime/types/data (LoadError)
I wrote an article about the process that was resolved when such an error occurred.
I think that there are different solutions depending on the environment and how to reach the error, so please use it as a reference only ~
macOS Catalina version 10.15.7 Homebrew 2.7.1 rbenv 1.1.2 ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19] gem 3.2.4 Bundler version 2.1.4
cannot load such file -- mime/types/data (LoadError)
When I checked the error part where a lot of characters were listed, there was a sentence that MIME :: Types
was already defined.
I checked the local gem with gem list
.
mime-types-data
is set to the default that can contain 2 versions.
Mmm, is this bad? ??
After a lot of research, it seems that gem update --default
is set for default
.
I haven't done that, but when I hit this command, it seems that the latest version of gem is installed at once and the latest version is set as the default.
For the time being, I decided to uninstall it and remove the default. First, cancel the default
Terminal
cd #Move to home directory
cd /Users/[username]/.rbenv/versions/[version]/lib/ruby/gems/[version]
#Go to the path confirmed above
ls #Check inside
build_info doc gems
cache extensions specifications ← The default settings are described in this
rm -rf specifications/default/
#Delete the default directory in the specifications (this will remove the default)
Uninstalling mime-types-data
Terminal
gem uninstall mime-types-data
bundle install
confirm.
gem list
There was only one version and default was canceled.
Write payjpm in Gemfile, bundle install
, rails s and the server started!
This error was due to mime-types-data. Although it is not described in the text, it took three days to resolve the results due to the occurrence of secondary and tertiary disasters by executing the investigation without thinking about anything. It is recommended that you understand what the commands in the terminal are for and how they work.
https://qiita.com/zQmjRAb73seN5RM/items/ecb9e19ee8f3e9af6018
https://mophie-blog.com/2020/08/17/oops-i-did-gem-update-not-bundle-update-rails-no-work/
https://qiita.com/Okame-chan/items/39052dc4d4c3cebfb1ee
Recommended Posts