Cpanel 中的 Ruby On Rails 问题

Posted

技术标签:

【中文标题】Cpanel 中的 Ruby On Rails 问题【英文标题】:Ruby On Rails Issue in Cpanel 【发布时间】:2013-09-26 13:49:29 【问题描述】:

当我通过 cpanel 启动我的应用程序时,我会收到此日志。

** 在 0.0.0.0:12001 开始 Mongrel 监听 ** 使用生产环境启动 Rails... /home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require': 没有要加载的文件 -- readline (MissingSourceFile) 来自/home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' 来自/home/pixelcor/ruby/gems/gems/rush-0.6.8/lib/rush/shell.rb:1 来自/home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' 来自/home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' 来自/home/pixelcor/ruby/gems/gems/rush-0.6.8/lib/rush/embeddable_shell.rb:1 来自/home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' 来自/home/pixelcor/ruby/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' 来自/home/pixelcor/ruby/gems/gems/rush-0.6.8/lib/rush.rb:87 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `require' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' 来自 /home/pixelcor/ruby/gems/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' 来自 /home/pixelcor/rails_apps/demo/config/boot.rb:117:in `load_gems' 来自 /home/pixelcor/ruby/gems/gems/rails-2.3.5/lib/initializer.rb:164:in `process' 来自 /home/pixelcor/ruby/gems/gems/rails-2.3.5/lib/initializer.rb:113:in `send' 来自 /home/pixelcor/ruby/gems/gems/rails-2.3.5/lib/initializer.rb:113:in `run' 来自/home/pixelcor/rails_apps/demo/config/environment.rb:17 来自 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 来自 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' 来自 /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 来自 /usr/bin/mongrel_rails:23:in `load' 来自 /usr/bin/mongrel_rails:23

谁能帮我克服这个错误。

【问题讨论】:

您是否先安装了运行 rails 所需的所有 gem?如果您可以访问 cpanel 上的命令行,请尝试在启动服务器之前运行 bundle install 它说 bundler:gemfilenotfound 我以 root 身份运行它 它仍然给我同样的错误。我已经安装了所有必需的 gem。甚至运行了 bundler,它确实使用了所有需要的东西。仍然得到同样的错误 【参考方案1】:

通过将依赖项放入 gemfile.local 来修复它 使用 rb-readline

【讨论】:

以上是关于Cpanel 中的 Ruby On Rails 问题的主要内容,如果未能解决你的问题,请参考以下文章

在 Rails 开发环境 smtp cpanel 上发送电子邮件 ruby

在 Ruby on Rails 3.2+ 中流式传输部分视图

ruby Ruby on Rails中的分叉进程

Ruby on Rails:高级搜索

Ruby on Rails 生产日志轮换

Ruby on Rails - Ruby 中的 KeyCode [关闭]