"未定义的符号:rb_Digest_MD5_Init"在运行Rails时

时间:2015-09-15 15:54:36

标签: ruby-on-rails ruby gem runtime-error

我正在尝试运行Ruby On Rails,但每次启动它时(即使我运行rails没有参数,它应该显示一些帮助)它会产生错误:

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>'

我在安装nokogiri gem时遇到了同样的错误,但我使用--use-system-libraries解决了它,安装得很好。我尝试以同样的方式安装rails,但它仍然无法正常工作。

此外,我尝试安装libssl-dev(一些谷歌搜索引导我进入SO问题,错误与我的相同),但它已经安装。

我使用的是最新版本的RVM(1.26.11),ruby(2.2.3)和rails(4.2.4)。

什么会导致这样的错误?

UPD:我已经看过this answer,它有唯一的答案告诉我安装一些没有做到这一点的软件包

1 个答案:

答案 0 :(得分:0)

好像我的个人资料文件夹搞砸了,因为我试图创建新用户并在其后安装rvmrails,一切正常。

UPD:似乎来自~/.config的东西导致了这个问题,因为在删除了一些文件夹后(无法准确判断出哪一个,因为我立刻删除了一堆文件夹)Rails终于开始工作了。 / p>