Thin LoadError:没有这样的文件来加载thin_parser
我已经安装了 Thin 并尝试执行 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>'
有人可以帮助我吗,提前致谢
I have installed thin and try to do thin start
, which end up with this error
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>'
Can someone help me out please, thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
输出表示一个名为
1.9
的目录,即注意:我的精简版本是 1.2.10。在下文中,我将使用系统上显示的路径。
由于某种原因,thin gem 不附带此目录。但名为/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/
thin_parser.so
的文件位于父目录所以我的第一个解决方案是创建一个目录
1.9
并将文件thin_parser.so复制到其中。现在
thin start
对我有用。或者,您可以编辑文件
/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/thin.rb
并更改为
或更简单的
我不确定哪种解决方法更好,因为我不知道在不存在的目录中还需要什么文件。我也不知道Thin.win在哪里?叉子变得很重要。
我决定支持第一个解决方案。但这两种方法都为我解决了问题。
谨致问候,
蒂姆
the output denotes a directory called
1.9
i.e.<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.8-x86-mingw32/lib/1.9/
Note: My thin version is 1.2.10. In the following i will use the path as it appears on my system.
For some reason the thin gem doesn't come with this directory. But a file called
thin_parser.so
resides in the parent directory<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/
So my first solution was to create a directory
1.9
and copy the file thin_parser.so to it.Now
thin start
works for me.Alternatively you can edit the file
<ruby_install_dir>/lib/ruby/gems/1.9.1/gems/thin-1.2.10/lib/thin.rb
and changeto
or even simpler
I'm not sure what workaround is the better one, since i don't know what else files thin expects in the not existing directory. I don't know either where the Thin.win? fork becomes important.
I decided in favor of the first solution. But both ways fixed the Problem for me.
Best regards,
Tim
我在运行 rake db:migrate 时遇到了同样的错误(我怀疑精简启动会给我带来同样的错误。)
我在 Amazon Linux(基于 rpm,与 CentOS 和 Redhat 类似)上运行)。我之前已经以root身份安装了thin(gem install Thin)。虽然它可能与您的情况无关,但为了完整起见,我还使用以下方式安装了 eventmachine:
这是我得到的错误:
根据上述信息,我在 strace 下运行 rake 并发现它正在寻找 Thin_parser.so错误的地方。我能够通过安装这个符号链接来解决这个问题(因为我以root身份安装了thin,所以我以root身份执行了此操作)。显然,请将路径调整为您的 Thin 版本的安装位置:
噗!这为我解决了这个问题。
I ran into this same error when running
rake db:migrate
(I suspect thin start would have given me the same error.)I'm running on Amazon Linux (rpm based, so similar to CentOS and Redhat). I had previously installed thin as root (gem install thin). Although it may be irrelevant to your situation, just for completeness, I had also installed eventmachine using:
Here is the error I got:
Based on the above information, I ran rake under strace and discovered that it was looking for thin_parser.so in the wrong place. I was able to fix the problem by installing this symbolic link (I did this as root since I installed thin as root). Obviously, adjust the path to where your version of thin is installed:
Poof! That fixed it for me.