2012-04-12 105 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