Rails 3、Thin 和 Nginx

发布于 2024-10-11 19:40:26 字数 3228 浏览 7 评论 0原文

当我尝试开始精简并点击 URL 时,出现以下错误。有关如何解决此问题的任何指示吗?

/usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core/configuration_options.rb:9:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)
    from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core/configuration_options.rb:9
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core.rb:17
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rspec-2.3.0/lib/rspec.rb:1
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
    from /root/company/project/config/application.rb:8
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /root/company/project/config/environment.rb:2
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /root/company/project/config.ru:3
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from /root/company/project/config.ru:1:in `new'
    from /root/company/project/config.ru:1

When I try to start thin and hit the URL, I get the below error. Any pointers on how can i resolve this?

/usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core/configuration_options.rb:9:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)
    from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core/configuration_options.rb:9
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.3.1/lib/rspec/core.rb:17
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /usr/lib/ruby/gems/1.8/gems/rspec-2.3.0/lib/rspec.rb:1
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
    from /root/company/project/config/application.rb:8
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /root/company/project/config/environment.rb:2
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /root/company/project/config.ru:3
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from /root/company/project/config.ru:1:in `new'
    from /root/company/project/config.ru:1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美人迟暮 2024-10-18 19:40:27

在配置文件中查找包含 ~ 的文件路径。可能您的 Gemfile 中有一个 ~ 位于与 rspec 相关的行上。跟踪似乎表明 Bundler 无法初始化 rspec,因为有一个带有波浪号字符的路径无法扩展,因为当应用程序通过 Thin 启动时没有 HOME 环境变量。找到它后,将路径替换为完全限定的路径。

Look in your config files for a file path that includes a ~. Possibly you have a ~ in your Gemfile on a line that's somehow related to rspec. The trace seems to show that Bundler is failing to initialise rspec because there's a path with a tilde character that can't be expanded because there's no HOME environment variable when the application is started via thin. When you find it, replace the path with a fully qualified one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文