Thin LoadError:没有这样的文件来加载thin_parser

Sou*_*ikj 4 thin ruby-on-rails-3

我已经安装了瘦并尝试做thin start,最终导致此错误

C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- C:/Ruby192/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/lib/1.9/thin_parser (LoadError)
    from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/lib/thin.rb:48:in `rescue in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/lib/thin.rb:43:in `<top (required)>'
    from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/bin/thin:5:in `<top (required)>'
    from C:/Ruby192/bin/thin:19:in `load'
    from C:/Ruby192/bin/thin:19:in `<main>'
Run Code Online (Sandbox Code Playgroud)

请有人帮帮我,谢谢你提前

bun*_*ter 5

输出表示名为1.9ie 的目录

<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/lib/1.9/

注意:我的瘦版本是1.2.10.在下面我将使用我的系统上显示的路径.

由于某种原因,瘦宝石不附带此目录.但是一个名为的文件thin_parser.so驻留在父目录中<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/

所以我的第一个解决方案是创建一个目录1.9并将文件thin_parser.so复制到它.现在thin start适合我.

或者,您可以编辑文件<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/thin.rb并进行更改

if Thin.win?
  # Select proper binary under Windows
  major_ruby_version = RUBY_VERSION[/^(\d+\.\d+)/]
  require "#{Thin::ROOT}/#{major_ruby_version}/thin_parser"
else
  require "#{Thin::ROOT}/thin_parser"
end
Run Code Online (Sandbox Code Playgroud)

if Thin.win?
  # Select proper binary under Windows
  major_ruby_version = RUBY_VERSION[/^(\d+\.\d+)/]
  require "#{Thin::ROOT}/thin_parser"
else
  require "#{Thin::ROOT}/thin_parser"
end
Run Code Online (Sandbox Code Playgroud)

甚至更简单

require "#{Thin::ROOT}/thin_parser"
Run Code Online (Sandbox Code Playgroud)

我不确定哪种解决方法更好,因为我不知道在不存在的目录中还有哪些文件瘦.我不知道Thin.win在哪里?叉变得重要.

我决定支持第一个解决方案.但两种方式都为我解决了问题.

最好的问候,
蒂姆