LoadError: cannot load such file -- haml
LoadError: cannot load such file -- haml error and quite jammed, so I'll leave it at that.
- Ruby 2.5.1
- Rails 5.2.3
rails aborted! LoadError: cannot load such file -- haml /Users/ユーザー名/mysite/koto_mono/config/application.rb:7:in `<top (required)>' /Users/ユーザー名/mysite/koto_mono/Rakefile:4:in `<top (required)>' /Users/ユーザー名/mysite/koto_mono/bin/rails:9:in `<top (required)>' /Users/ユーザー名/mysite/koto_mono/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>'
Anyway, I did bundle install, but it was not fixed.
Determined the version of haml.
＄gem list haml haml (default: 5.1.1, 5.0.4)
Since there is no file, I checked whether the file exists with the following command.
find ~/.rbenv -type f | grep haml
/Users/ユーザー名/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/haml-5.0.4/.yardopts /Users/ユーザー名/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/haml-5.0.4/REFERENCE.md /Users/ユーザー名/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/haml-5.0.4/haml.gemspec /Users/ユーザー名/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/haml-5.0.4/bin/haml /Users/ユーザー名/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/haml-5.0.4/CHANGELOG.md . . . .
And a lot of code comes out、、、 but is that it? There is a file for 5.0.4, but there is no file for 5.1.1!?
So I'm going to reinsert 5.1.1 in haml.
$ gem uninstall haml -v 1.14.3 $ gem install
When I do rails with this, the error disappeared.