“undefined symbol: rb_Digest_MD5_Init” while runni

2019-09-07 20:46发布

I am trying to run Ruby On Rails, but every time I start it (even if I run rails without arguments, when it should display some help) it produces an error:

serge1peshcoff@myLaptop:~$ rails
/home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/x86_64-linux/digest/md5.so: undefined symbol: rb_Digest_MD5_Init - /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/x86_64-linux/digest/md5.so (LoadError)
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/gems/railties-4.2.4/lib/rails/generators/app_base.rb:1:in `<top (required)>'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/gems/railties-4.2.4/lib/rails/generators/rails/app/app_generator.rb:1:in `<top (required)>'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/gems/railties-4.2.4/lib/rails/commands/application.rb:2:in `<top (required)>'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/gems/railties-4.2.4/lib/rails/cli.rb:14:in `<top (required)>'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/gems/railties-4.2.4/bin/rails:9:in `<top (required)>'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/bin/rails:23:in `load'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/bin/rails:23:in `<main>'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /home/serge1peshcoff/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

I've faced the same error while installing nokogiri gem, but I solved it by using --use-system-libraries, it installed fine. I tried to install rails the same way, but it still doesn't work.

Also I tried to install libssl-dev (some googling led me to the SO question with the error the same as mine) but it was already installed.

I am using the latest version of RVM (1.26.11), ruby (2.2.3) and rails (4.2.4).

What can cause such an error?

UPD: I've seen this answer, it has the only answer telling me to install some packages, which didn't do the trick

1条回答
我只想做你的唯一
2楼-- · 2019-09-07 21:32

It seems like my profile folder is messed up, because I tried to create new user and install rvm and rails after it, and everything worked fine.

UPD: it seems like something from ~/.config caused the problem, because after removing some folders (can't tell exactly which one, because I removed a bunch of them at once) Rails finally started to work.

查看更多
登录 后发表回答