【问题标题】:Thin doesn't start rails serverThin 不启动 Rails 服务器
【发布时间】:2012-04-12 22:50:11
【问题描述】:

我有一个带有 rails(rvm) + nginx + Thin 的 ubuntu 服务器。

Nginx 正在监听 3000-3 端口,如果我手动启动 rails 效果很好,所以我猜问题出在 Thin。

我已将瘦配置为在端口 3000,3001,3002 中启动 3 个服务器实例,但它们没有启动并且没有报告错误。

我在 /etc/thin 中只有一个文件,这是正常的还是我遗漏了什么?该文件是 railsapp.yml。

如果我运行 bundle exec thin start,它运行正常。

编辑:运行时出现错误:

thin start --all /etc/thin

这是日志中的错误:

/home/metaloviana/.rvm/gems/ruby-1.9.2-p318@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rack 1.4.1, but your Gemfile requires rack 1.3.5. Using bundle exec may solve this. (Gem::LoadError)

编辑 2:

问题解决了。使用 railsgems-bundler 和 rvm 包装器。

谢谢大家!

【问题讨论】:

  • 你试过bundle exec thin start --all /etc/thin吗?
  • 它可以工作,但 init.d 守护进程不能

标签: ruby-on-rails ubuntu nginx rvm thin


【解决方案1】:

同意@shime。

错误日志表明 ruby​​gem 发现了很多不同版本的 rake,它不知道使用哪个版本。

请记住,始终使用“bundle exec”来执行 rake 任务,例如

bundle exec thin start 
bundle exec rake db:migrate
bundle exec rspec spec
bundle exec rails generate scaffold...

【讨论】:

  • 我已经安装了 ruby​​gems-bundler(感谢来自 #rvm@freenode 的好人)并且瘦启动 --all /etc/thin 工作。 init.d 守护进程没有
  • 谢谢!但是看看你写了多少次bundle exec。有一个 gem 给它起别名。这很酷,值得一试。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-04-20
  • 1970-01-01
  • 1970-01-01
  • 2012-12-12
  • 1970-01-01
  • 2014-10-07
  • 2013-05-31
相关资源
最近更新 更多