Ruby DevKit不适用于WindowsXP上的RedCloth和其他宝石 [英] Ruby DevKit not working for RedCloth and other gems on WindowsXP

查看:164
本文介绍了Ruby DevKit不适用于WindowsXP上的RedCloth和其他宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个全新的RoR,没有太多的Web开发经验。我通常在这一点上放弃,但我需要一个RoR开发环境才能找到工作,我不能选择网站创建者的大脑,因为他是公司以外的人,并且明确表示他完全不熟悉Windows(他开发在Mac上,我开始明白为什么......)。这是我第一次发布,所以要善良...



目标:能够在本地机器上查看基于RoR的网站,一个预先存在的XAMMP服务器,但使用rails服务器也可以。




环境: strong>
Windows XP
Xammp 1.7.3
Ruby 9.1.2
DevKit 4.5.0。



我试过的:
我开始遵循本教程的指导(在Windows机器上安装Xampp和Rails http://www.grapethinking.com/getting-rails-to-work-on-a-windows-machine - 运行-XAMPP )。我成功完成了所有步骤,并能够创建一个Rails应用程序并查看Welcome Aboard页面。



我从heroku网站上获得本地副本( http://heroku.com/ ),他们使用的ror托管服务。我按照Xampp和Rails教程的第5步中所述修改了Apache配置文件以指向站点的公用文件夹。在这一点上,我去localhost时得到以下消息:3000

 访问被禁止! 

您无权访问请求的目录。没有索引文件或目录是读保护的。

如果您认为这是服务器错误,请与网站管理员联系。
错误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 s,它抱怨说:

 在任何源代码中找不到RedCloth-4.2.3,请尝试运行'捆绑安装'。 

所以我发现这篇文章描述了我的情况( https://github.com/oneclick / ruby​​installer / wiki / Development-Kit )。



DevKit无法正常工作。 config.yml文件自动拥有我安装ruby的位置(在.... xampp / ruby​​ / Ruby192中),并且它没有抱怨地运行,除了在步骤5中测试它是否实际上使用命令gem install rdiscount --platform = ruby​​,它产生了以下错误:

  C:\RubyDevKit> gem install rdiscount --platform = ruby 
暂时增强PATH以包含DevKit ...
构建原生扩展。这可能需要一段时间...
错误:安装rdiscount错误:
错误:无法构建gem本机扩展。

C:/ Documents and Settings / Lyla / My Documents / new / XAMPP_Server_2010 / XAMPP_Install
/xampp/ruby/Ruby192/bin/ruby.exeextconf.rb
检查随机()... *** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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:在`try_do'中:编译器失败t
o生成可执行文件。 (RuntimeError)
您必须先安装开发工具。
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:从C:/ Documents and Settings / Lyla / My Documents / new / XAMPP_Server_2010 / X
获得try_link0'
AMPP_Install / xampp / ruby​​ / Ruby192 / lib / ruby​​ / 1.9.1 / mkmf.rb:440:在`try_link'
从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:在C:/ Documents and Settings / Lyla / My Documents / new / XAMPP_Server_2010 / X
AMPP_Install / xampp / ruby​​ / Ruby192 / lib / ruby​​ / 1.9.1 / mkmf的`try_func'
中。 rb:797:在`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`阻止检查
_for'
从C:/ Documents and Settings / Lyla / My Documents / new / XAMPP_Server_2010 / X
AMPP_Install / XAMPP /红宝石/ Ruby192 / LIB /红宝石/ 1。 9.1 / mkmf.rb:280:在`block(2 levels)
从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:在`open'
从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:在`block in bblock
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:在'open'中
从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:在`推迟'
从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:在'checking_for'
from C:/ Documents and Settings / Lyla / My Documents / new / XAMPP_Server_2010 / X
AMPP_Instal l / xampp / ruby​​ / Ruby192 / lib / ruby​​ / 1.9.1 / mkmf.rb:796:在`have_func'
从extconf.rb:5:在< main>'


Gem文件将保持安装在C:/ Documents and Settings / Lyla / My Documents / n
ew / XAMPP_Server_2010 / XAMPP_Install / xampp / ruby​​ / Ruby192 / lib / ruby​​ / gems / 1.9.1 /宝石/ r
折扣-1.6.5进行检验。
结果记录到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 gem,无论如何,该解决方案似乎有点特定于此:
我无法使用适用于Windows XP的ruby开发工具包



我不确定他在修改fstab文件时说的是什么...也许这会帮助我?不幸的是我找不到fstab文件,我的devkit根文件夹中没有msys文件夹。我无法在ruby install的bin文件夹或devkit中的各种bin文件夹中找到gcc.bat,make.bat或sh.bat。



还有张贴( http://www.ruby-forum.com/topic/186191 )这暗示了一些我不能真正遵循的东西......这也是从2009年开始,所以我认为它可能已经过时了。



帮助并感谢您!

解决方案

老实说,我实际上并不打算在Windows上设置它。它可能是完全无法管理的,并且有时会令人沮丧(我从经验中知道这一点)。有一个原因是有一个非常小的使用Windows的Rails开发人员社区。大多数人都使用OS X或Linux。



创建一个类似于 VirtualBox (免费)并在那里设置Rails堆栈。这是一个更加无痛的环境,你不会回头看。或者,如果您不想自己完成所有设置,请使用 BitNami RubyStack 。这是一个预先配置的Ruby / Rails环境,您可以将它用作虚拟机,或者安装到您的计算机上(我会选择前者)。



希望能帮到您!

I'm a completely new to RoR and don't have much web development experience. I usually give up at this point, but I need a RoR dev environment for a job and I can't pick the brain of the site's creator because he's someone outside of the company and made it clear that he's completely unfamiliar with Windows (he develops on a mac and I'm starting to see why...). This is my first time posting so be kind...

Goal: Be able to view a RoR based site on local machine, preferably using a pre-existing XAMMP Server, but using the rails server would be fine too.


Environment: Windows XP Xammp 1.7.3 Ruby 9.1.2 DevKit 4.5.0.

What I've tried: I started with following the directions in this tutorial (Install Xampp and Rails on a Windows Machine http://www.grapethinking.com/getting-rails-to-work-on-a-windows-machine-running-xampp). I got through all the steps successfully and was able to create a rails app and see the "Welcome Aboard" page.

I got a local copy of the site off of heroku (http://heroku.com/), the ror hosting service that they use. I modified the apache configuration file to point to the public folder of the site as described in step 5 of the Xampp and Rails tutorial. At this point I got the following message when going to 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

I wasn't sure how to change permissions on a windows machine or if this was even the problem. I tried running "rails s" which complained:

Could not find RedCloth-4.2.3 in any of the sources, Try running 'bundle install'.

So I found this post which described my situation (http://www.ruby-forum.com/topic/204455) which led to me downloading the DevKit. At this point I uninstalled ruby and reinstalled it with the correct installer. I installed the devkit following the instructions on their site (https://github.com/oneclick/rubyinstaller/wiki/Development-Kit).

The DevKit is not working. The config.yml file automagically had the location where I installed ruby (in ....xampp/ruby/Ruby192) and it ran without complaining, except during step 5 where you test to see if it actually worked with the command "gem install rdiscount --platform=ruby" which produced the following error:

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

So it does have the "Temporarily enhancing PATH to include DevKit..." but nothing else works. A similar error occurs when trying to install RedCloth.

I found this post which seems very related, but it's for getting dbd-odbc gem, whatever that is, to work and the solution seems somewhat specific to that: I can't get the ruby development kit working for Windows XP

I wasn't sure what he was talking about with the modifying the fstab file...maybe that would help me? Unfortunately I can't find the fstab file, I don't have a msys folder in my devkit root folder. I can't find gcc.bat, make.bat, or sh.bat in my ruby install's bin folder or in the various bin folders in devkit.

There's also this post (http://www.ruby-forum.com/topic/186191) which suggests some stuff I can't really follow...it's also all from 2009 so I figured it might be old.

help and thank you!

解决方案

To be completely honest, I would actually not bother with setting it up on Windows. It can be completely unmanageable and beyond frustrating at times (I know this from experience). There is a reason that there is a very small community of Rails developers that use Windows. Most everyone else uses OS X or a flavor of Linux.

Create an Ubuntu virtual machine with something like VirtualBox (free) and set up the Rails stack on there. It's a much more pain-free environment, and you won't look back. Alternatively, if you don't want to do all the setup yourself, use the BitNami RubyStack. It's a preconfigured Ruby/Rails environment that you can either use as a virtual machine, or install on your computer (I'd opt for the former).

Hope that helps!

这篇关于Ruby DevKit不适用于WindowsXP上的RedCloth和其他宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆