2012-07-11 38 views
19

我正在關注Heroku/Facebook集成的Heroku教程(但我懷疑這個問題與Facebook的整合無關),我被困在了我應該開始的舞臺上工頭(我已經安裝了Heroku的installbelt的Windows,其中包括領班):工頭在Heroku教程下的Windows啓動失敗

> foreman start 

給出:

C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find foreman (>= 0) amongst [POpen4-0.1.4, Platform-0.4.0, ZenTest-4.6.2, abstract-1.0.0, actionm 
ailer-3.0.11, actionmailer-3.0.9, actionpack-3.0.11, actionpack-3.0.9, activemodel-3.0.11, activemodel-3.0.9, activerecord-3.0.11, activerecord-3.0.9, activerecord-sqlserver-adapter-3.0.15, activereso 
urce-3.0.11, activeresource-3.0.9, activesupport-3.0.11, activesupport-3.0.9, addressable-2.2.6, annotate-2.4.0, arel-2.0.10, autotest-4.4.6, autotest-growl-0.2.16, autotest-rails-pure-4.1.2, autotest 
-standalone-4.5.8, builder-2.1.2, bundler-1.0.15, diff-lcs-1.1.3, erubis-2.6.6, factory_girl-1.3.3, factory_girl_rails-1.0, faker-0.3.1, gravatar_image_tag-1.0.0.pre2, heroku-2.14.0, i18n-0.5.0, json- 
1.6.1, launchy-2.0.5, mail-2.2.19, mime-types-1.17.2, mime-types-1.16, nokogiri-1.5.0-x86-mingw32, open4-1.1.0, pg-0.11.0-x86-mingw32, polyglot-0.3.3, polyglot-0.3.1, rack-1.2.4, rack-1.2.3, rack-moun 
t-0.6.14, rack-test-0.5.7, rails-3.0.11, rails-3.0.9, railties-3.0.11, railties-3.0.9, rake-0.9.2.2, rake-0.8.7, rb-readline-0.4.0, rdoc-3.11, rdoc-3.8, rest-client-1.6.7, rspec-2.6.0, rspec-core-2.6. 
4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, rspec-rails-2.6.1, rubygems-update-1.8.11, rubyzip-0.9.4, rubyzip2-2.0.1, spork-0.9.0.rc8-x86-mingw32, sqlite3-1.3.3-x86-mingw32, sqlite3-ruby-1.3.3, te 
rm-ansicolor-1.0.7, thor-0.14.6, tiny_tds-0.4.5-x86-mingw32, treetop-1.4.10, treetop-1.4.9, tzinfo-0.3.31, tzinfo-0.3.29, webrat-0.7.1, will_paginate-3.0.pre2, win32-api-1.4.8-x86-mingw32, win32-open3 
-0.3.2-x86-mingw32, win32-process-0.6.5, windows-api-0.4.0, windows-pr-1.2.1, zip-2.0.2] (Gem::LoadError) 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec' 
     from C:/RailsInstaller/Ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems.rb:1210:in `gem' 
     from C:/Program Files (x86)/ruby-1.9.3/bin/foreman:18 

因爲我在這是一個完整的noob我不知道如果我的問題這裏是Error on 'foreman start' while following the Python/Flask Heroku tutorial的副本(因爲它不完全是t他同樣的錯誤)。如果是這樣,有沒有人有一個方法在Windows上部署開發環境(適用於Heruko,Python,Facebook應用程序)?或者我應該使用Ubuntu嗎?

感謝

回答

29

雖然這個問題似乎並不感興趣的人在這裏(在〜2小時,0答案0條評論... 5次),我已經找到了解決方案,並準備分享它與任何人都會遇到它:

  1. rubyinstaller.org(1.9.3-P194)安裝最新的紅寶石 - 有時存在衝突的同一版本安裝在我的情況我剛剛卸載所有版本的紅寶石,但如果你已經有其他的應用程序需要更老的版本,那麼你必須更加小心

  2. 檢查您的系統默認在命令行提示符下調用ruby -v使用此版本:和獲取ruby 1.9.3p194 (2012-04-20) [i386-mingw32](您可能必須關閉並重新打開cmd,包括新的環境變量)

  3. 仍在cmd中,調用:

    gem install foreman 
    gem install taps 
    
  4. 現在去你的Procfile的應用程序(如從教程您的Heroku的示例應用程序),並執行foreman start,你應該看到這樣的事情:後手動添加紅寶石路到我的系統PATH環境變量(Win 7的)

    18:23:52 web.1 | started with pid 7212 
    18:23:54 web.1 | * Running on http://0.0.0.0:5000/ 
    18:23:54 web.1 | * Restarting with reloader 
    
+2

我知道謝謝你的評論有點失禮,但是謝謝你。我有幾個版本的Ruby踢,我沒有意識到我的開發箱是如此混亂。我最終不得不卸載並手動清理ruby目錄和環境變量,然後重新安裝這個hereoku工具包。 – paulecoyote 2012-12-23 23:02:38

+4

現在我得到一個「錯誤的文件描述符」錯誤... – newshorts 2013-03-13 07:44:12

+1

@ newe1344 - 這是否有幫助? https://github.com/mauricemach/zappa/issues/59 – zenpoy 2013-03-13 11:34:46

4

,它仍然沒」工作。

我不得不改變默認的

C:\Program Files(x86)\Heroku 安裝的Heroku的路徑 C:\Heroku

因爲它沒有妥善處理路徑的空間。我也試過C:\PROGRA~2\Heroku\ruby-1.9.2\bin無濟於事。我想象任何無空間的路徑都行。

hth

+0

這工作就像一個魅力。不知道如何..:| – 2015-01-04 20:21:57