私はRoRにまったく慣れておらず、Web開発の経験があまりありません。私は通常この時点で諦めますが、仕事にはRoR開発環境が必要です。彼は社外の誰かであり、彼がWindowsに完全に慣れていないことを明らかにしたため、サイトの作成者の頭脳を選ぶことができません(彼は開発していますMacで、理由がわかり始めています...)。初めての投稿ですので、よろしくお願いします...
目標:ローカルマシンでRoRベースのサイトを表示できるようにします。できれば、既存のXAMMPサーバーを使用しますが、railsサーバーを使用しても問題ありません。
環境: Windows XP Xammp 1.7.3 Ruby 9.1.2DevKit4.5.0。
私が試したこと: このチュートリアルの指示に従うことから始めました(WindowsマシンにXamppとRailsをインストールするhttp://www.grapethinking.com/getting-rails-to-work-on-a-windows-machine- running-xampp)。すべての手順を正常に完了し、railsアプリを作成して、「WelcomeAboard」ページを表示することができました。
彼らが使用しているrorホスティングサービスであるheroku(http://heroku.com/ )からサイトのローカルコピーを入手しました。Xampp and 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マシンのアクセス許可を変更する方法、またはこれが問題であるかどうかさえわかりませんでした。「rails」を実行してみましたが、次のような不満がありました。
Could not find RedCloth-4.2.3 in any of the sources, Try running 'bundle install'.
そのため、DevKitをダウンロードすることになった私の状況(http://www.ruby-forum.com/topic/204455 )を説明するこの投稿を見つけました。この時点で、rubyをアンインストールし、正しいインストーラーを使用して再インストールしました。彼らのサイト( https://github.com/oneclick/rubyinstaller/wiki/Development-Kit )の指示に従って開発キットをインストールしました。
DevKitが機能していません。config.ymlファイルには自動的にrubyをインストールした場所(.... xampp / ruby / Ruby192内)があり、「gem install」コマンドで実際に機能するかどうかをテストするステップ5を除いて、文句なしに実行されました。 rdiscount --platform = ruby "は、次のエラーを生成しました:
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
したがって、「一時的にPATHを拡張してDevKitを含める...」がありますが、他には何も機能しません。RedClothをインストールしようとすると、同様のエラーが発生します。
この投稿は非常に関連しているようですが、dbd-odbc gemを機能させるためのものであり、解決策はそれに固有のよう です。WindowsXPでruby開発キットを機能させることができません。
彼がfstabファイルの変更について何について話しているのかわかりませんでした...多分それは私を助けるでしょうか?残念ながら、fstabファイルが見つかりません。devkitルートフォルダーにmsysフォルダーがありません。ruby installのbinフォルダーまたはdevkitのさまざまなbinフォルダーにgcc.bat、make.bat、またはsh.batが見つかりません。
この投稿(http://www.ruby-forum.com/topic/186191)もありますが、これは私が実際にはフォローできないものを示唆しています...これもすべて2009年のものなので、古いかもしれないと思いました。
助けてくれてありがとう!