1

I am having trouble with creating a new rails project. When I run rails new project_name it comes to the rails webpacker:install it fails with the following error:

LoadError: libffi.so.8: cannot open shared object file: No such file or directory - /home/matija/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/ffi-1.15.4/lib/ffi_c.so
/home/matija/Documents/learning-rails/course-project/config/application.rb:7:in `<main>'
/home/matija/Documents/learning-rails/course-project/Rakefile:4:in `<main>'
/home/matija/Documents/learning-rails/course-project/bin/rails:5:in `<top (required)>'
<internal:/home/matija/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/home/matija/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/home/matija/Documents/learning-rails/course-project/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/home/matija/Documents/learning-rails/course-project/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'

Caused by:
LoadError: cannot load such file -- 3.0/ffi_c
/home/matija/Documents/learning-rails/course-project/config/application.rb:7:in `<main>'
/home/matija/Documents/learning-rails/course-project/Rakefile:4:in `<main>'
/home/matija/Documents/learning-rails/course-project/bin/rails:5:in `<top (required)>'
<internal:/home/matija/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/home/matija/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/home/matija/Documents/learning-rails/course-project/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/home/matija/Documents/learning-rails/course-project/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'
(See full trace by running task with --trace)

I am using ASDF for ruby version management.

I tried many solutions like uninstalling and installing the gem, running gem pristine and some other methods that are provided on SO and here.

3
  • 2
    libffi.so.8 is provided by the package libffi8ubuntu1 ... which is available for Ubuntu 21.04 . ..... and for Ubuntu 21.10, the package name is libffi8 packages.ubuntu.com/… . ............. Please specify Ubuntu version : In your question. Nov 23 '21 at 13:36
  • 1
    Testing with Ubuntu 20.04 : Installing the Ubuntu 21.10 libffi8 ......... sudo gdebi libffi8_3.4.2-1ubuntu5_amd64.deb packages.ubuntu.com/impish/amd64/libffi8/download .......... No issues, no dependencies. Nov 23 '21 at 14:26
  • I am using Ubuntu 20.04
    – mberc
    Nov 23 '21 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.