我是一個全新的RoR,沒有太多的Web開發經驗。我通常在這一點上放棄,但我需要一個RoR開發環境才能找到工作,而且我無法選擇網站創建者的大腦,因爲他是公司以外的人,並且明確表示他完全不熟悉Windows(他開發在Mac上,我開始明白爲什麼......)。這是我第一次發佈這樣善良......Ruby DevKit不適用於WindowsXP上的RedCloth和其他寶石
目標:能夠查看本地計算機上的基於RoR的網站,最好使用預先存在的XAMMP服務器,但使用Rails服務器將罰款太。
環境: 的Windows XP XAMMP 1.7.3 紅寶石9.1.2 的devkit 4.5.0。
我已經試過: 我開始使用本教程之後的方向(在Windows計算機上安裝http://www.grapethinking.com/getting-rails-to-work-on-a-windows-machine-running-xampp XAMPP和Rails)。我成功完成了所有步驟,並能夠創建一個Rails應用程序並查看「Welcome Aboard」頁面。
我收到了一個關於他們使用的ror託管服務的heroku(http://heroku.com/)的本地副本。我按照Xampp和Rails教程的第5步中所述修改了Apache配置文件以指向站點的公用文件夾。在這一點上我去到localhost時以下消息:3000
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
11/4/2010 2:19:12 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
我不知道如何更改Windows機器上的權限,或者這是連問題。我試圖運行「軌道的」這抱怨:
Could not find RedCloth-4.2.3 in any of the sources, Try running 'bundle install'.
所以我發現這個職位它說明了我的情況(http://www.ruby-forum.com/topic/204455),這導致我下載的devkit。此時我卸載了ruby並使用正確的安裝程序重新安裝了它。我按照其網站上的說明安裝了開發工具包(https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)。
DevKit無法正常工作。 config.yml文件自動具有我安裝ruby的位置(在.... xampp/ruby/Ruby192中),並且它沒有抱怨地運行,除了在步驟5中測試它是否實際上使用命令「gem install rdiscount --platform =紅寶石」,這將產生以下錯誤:
C:\RubyDevKit>gem install rdiscount --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
"C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/XAMPP_Install
/xampp/ruby/Ruby192/bin/ruby.exe" extconf.rb
checking for random()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010
/XAMPP_Install/xampp/ruby/Ruby192/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/XAMPP_Install/
xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed t
o generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_fun
c'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking
_for'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels)
in postpone'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone
'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2010/X
AMPP_Install/xampp/ruby/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'
Gem files will remain installed in C:/Documents and Settings/Lyla/My Documents/n
ew/XAMPP_Server_2010/XAMPP_Install/xampp/ruby/Ruby192/lib/ruby/gems/1.9.1/gems/r
discount-1.6.5 for inspection.
Results logged to C:/Documents and Settings/Lyla/My Documents/new/XAMPP_Server_2
010/XAMPP_Install/xampp/ruby/Ruby192/lib/ruby/gems/1.9.1/gems/rdiscount-1.6.5/ex
t/gem_make.out
所以它確實有‘暫時提升路徑包括的devkit ......’但沒有別的作品。嘗試安裝RedCloth時發生類似的錯誤。
我發現這個職位似乎很相關,但它是爲獲得DBD-ODBC寶石,不管它是什麼,工作和解決方案似乎有些特定於: I can't get the ruby development kit working for Windows XP
我不知道他正在討論修改fstab文件......也許這會幫助我?不幸的是我找不到fstab文件,我的devkit根文件夾中沒有msys文件夾。我無法在ruby install的bin文件夾或devkit中的各個bin文件夾中找到gcc.bat,make.bat或sh.bat。
還有這個帖子(http://www.ruby-forum.com/topic/186191),它暗示了一些我不能真正遵循的東西......它也是從2009年開始的,所以我認爲它可能是舊的。
幫助和謝謝!
我收到錯誤消息「您必須先安裝開發工具。」即使它告訴了我一切,「臨時增強PATH以包括DevKit ...」。事實證明,我有錯誤的devkit版本,我需要ruby 1.9的「tdm」devkit,而不是僅用於ruby 2.0的最新開發包。 – Ninjaxor 2013-07-04 17:19:43