Image not found error when starting rails server

Asked 2 years ago, Updated 2 years ago, 76 views

When I did bundle exec rails locally, I got the following error:

/Users/xxxxx/project_name/vendor/bundle/ruby/2.6.0/gems/ffi-1.11.1/lib/ffi/library.rb: 145:in `block in ffi_lib': 

Could not open library'/Users/xxxxxx/project_name/vendor/bundle/ruby/2.6.0/gems/sasc-2.2.1/ext/libsass.bundle': 

dlopen(/Users/xxxxx/project_name/vendor/bundle/ruby/2.6.0/gems/sasc-2.2.1/ext/libsass.bundle,5)—image not found (LoadError)

As you can see in the error, /Users/xxxxx/project_name/vendor/bundle/ruby/2.6.0/gems/sasc-2.2.1/ext/ and there was certainly no libsass.bundle.(There is a libsass)

Also, when I go to vendor/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext/ in the working project, there is no libsass.bundle, only libsass exists

As I looked into it, I couldn't find any particular solution, so I would like you to advise me if anyone knows how to solve it or how to solve it.

Thank you for your cooperation.

environment

  • Mac OS Catalina
  • ruby 2.6.4
  • Gem is installed with bundle install --path vendor/bundle

The first occurrence
It came out when I uninstalled mysql and reinstalled it with brew install.

Tried
Reinstall ruby (2.6.4) via rbenv

ruby-on-rails ruby rubygems

2022-09-30 13:56

1 Answers

I just tried the following two methods, and the rails server started running either way.

  • bundle update=>Gemfile.lock is updated=>bundle exec rails
  • Turn off Gemfile.lock=>bundle install --path vendor/bundle=>bundle exec rails

I understand that the library referenced in Gemfile.lock may be the cause, but it is not the root cause.

Rather, I think it's not a good point to see Gemfile.lock as a change difference even though you haven't updated Gem.

Therefore, we will continue to open our answers.


2022-09-30 13:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.