2012-04-12 100 views
0

我有一个Ubuntu(rvm)+ nginx +瘦的服务器。薄不启动轨服务器

Nginx正在监听porst 3000-3,并且如果我手动启动rails,那么效果很好,所以我猜这个问题很简单。

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

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

如果我运行bundle exec瘦启动,它运行正常。

编辑:运行时,我得到一个错误:

thin start --all /etc/thin 

这是在日志中的错误:

/home/metaloviana/.rvm/gems/[email protected]/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包装器。

谢谢你们!

+1

您是否尝试过'bundle exec thin start --all/etc/thin'? – shime 2012-04-13 00:00:29

+0

它可以工作,但init.d deamon不会 – Papzord 2012-04-13 00:18:49

回答

2

同意@shime。

错误日志表明rubygem发现了不同版本的许多耙子,并且它不知道要使用哪个版本。

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

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

我已经安装了rubygems-bundler(感谢来自#rvm @ freenode的一个好人)和精简启动 - all/etc/thin工程。 init.d deamon不是 – Papzord 2012-04-13 00:21:35

+0

谢谢!但看看你已经写了多少次'bundle exec'。有一个[gem](https://github.com/gma/bundler-exec)将其别名。这非常酷,值得一试。 – shime 2012-04-13 00:26:35