1

Rails: 5 Ruby: 2.5.3 Gem: gem "ruby_mapscript" Error: /home/usermachine/.rvm/gems/ruby-2.5.3/gems/ruby_mapscript-0.3.0/lib/mapscript/mapscript_extensions.rb:3:in require: libruby-2.0.so.2.0: cannot open shared object file: No such file or directory - /home/usermachine/projects/projectname/lib/mapscript.so (LoadError)

Hi, when I try to start my rails server with "rails s" I get the above error for the ruby_mapscript gem. The file (/home/usermachine/projects/projectname/lib/mapscript.so) is very much present.

I tried sudo /sbin/ldconfig -v but the error remains.

Any suggestions?

KavitaC
  • 635
  • 7
  • 29
  • How was Ruby initially installed on the machine? It's possible that Ruby needs to be installed with the --enable-shared flag set, which varies slightly depending on how Ruby was installed – Tennesseej Jan 16 '19 at 23:31
  • What's the permission on the library file? Probably ok, but make sure you have read access. – lurker Jan 17 '19 at 03:32
  • 1
    @Tennesseej I installed Ruby using rvm install – KavitaC Jan 17 '19 at 17:46
  • 1
    I tried this -> rvm reinstall ruby-2.5.3 --enable-shared and still I have the same problem – KavitaC Jan 17 '19 at 21:15
  • @KavitaC do you see anything labeled as 'not found' when you run this cmd: `ldd /home/usermachine/projects/projectname/lib/mapscript.so` – Tennesseej Jan 19 '19 at 02:02
  • I was finally able to resolve this issue buy building mapserver from Git. Thank you all! – KavitaC Jan 30 '19 at 22:10
  • possible duplicate of https://stackoverflow.com/q/65000467/12544391 e.g. adding `gem "ffi"` to `Gemfile` fixes it – Dorian Aug 23 '21 at 17:10

0 Answers0