Windows 上的独立 RedCloth
上下文
我最近参与了一个软件开发项目,我希望使用文本标记编写技术文档(适合在代码存储库中与代码一起跟踪)。因为该项目已经在使用 Redmine,所以我想使用 Textile 从而避免其他开发人员学习另一种标记语言。我知道实现有所不同,因此本着 POLS 的精神,我想使用 RedCloth,由Redmine内部使用。
我们正在开发并部署到多个操作系统,包括 Windows。为了方便起见,以及仅使用 Windows 的非技术、非开发人员用户,我希望能够使用独立工具编译所述技术文档,最好部署为 单个安装程序。
我对 Ruby 是 100% 的新手,所以请耐心等待。我不打算在这个项目中使用 Ruby 进行开发,我只想在 Windows 上进行安装,剩下的事情我会处理。
帮助希望
我没有开发 Rails 应用程序,这是用于桌面安装的,所以不要告诉我“只在 Linux 上使用它”。我已经安装了 DevKit,它安装了 make
、g++
等,并被 ./configure
脚本接受为“健全的开发环境”。
我有一个简单的问题,我正在寻找一个简单的解决方案。谷歌搜索此问题已显示此问题 之前报道过,我只找到了切换到 Linux 的建议,以及告诉我它“就像宣传的那样工作”的人。
我想要一些实际的帮助,即使只是以我可以检查的可能故障点清单的形式。
环境
此问题发生在以前没有安装过 Ruby 的 Windows 7、64 位计算机上。我目前无法访问 32 位。
Linux安装不是问题。
问题
我刚刚下载了 Windows 版 Ruby 安装程序 Ruby 1.9.2-p136
,和 Ruby 开发套件 DevKit-tdm-32-4.5。 1-20101214-1400-sfx.exe
,这是编译RedCloth所必需的。两者都是当前在 Windows 上部署 Ruby 的推荐版本(或者我读到过)。
我正在遵循指示,到目前为止一切顺利。 Ruby 和 DevKit 都安装在默认路径中(文件夹名称中没有空格)。 config.yml
正确指向新安装,仅此而已。 ruby dk.rb install
运行良好。我现在可以在 Ruby 安装文件夹中看到一个名为 lib/ruby/site_ruby/devkit.rb
的文件,我认为这是编译预挂钩,用于在编译时设置 DevKit 的路径红宝石。正如预期的那样,代码指向正确的文件夹。
当我使用推荐的 gem install rdiscount --platform=ruby 命令测试安装时,我得到以下信息:
C:\DevKit>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:/Ruby192/bin/ruby.exe" extconf.rb
这有点令人困惑,所以我开始环顾四周,我可以找到文件 lib /ruby/gems/1.9.1/gems/rdiscount-1.6.5/ext/extconf.rb 文件。通过该文件夹中的 ruby extconf.rb 运行它会给出:
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:/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:/Ruby192/lib/ruby/1.9.1/mkmf.rb:678:in `flush': Broken pipe (Errno::EPIPE)
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:678:in `message'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:690:in `checking_for'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'
我在某处读到过 rdiscount 无法编译的地方(现在找不到它的链接) Windows,因此我按照说明继续从源存储库 (git clone git://github.com/jgarber/redcloth.git
) 获取 RedCloth 的源代码。
当我从给定目录尝试 rake install
时,我收到缺少 gem 的错误(diff-lcs
等),因此我使用 gem install diff- 安装它们lcs --version '=...'
然后我就可以开始真正的安装了。
当我到达那里时,rake
失败,出现以下消息:
(in c:/Users/carona/Desktop/redcloth)
rake aborted!
No such file or directory - gem build c:/Users/carona/Desktop/redcloth/redcloth.gemspec 2>&1
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:138:in ``'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:138:in `block in sh_with_code'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:137:in `chdir'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:137:in `sh_with_code'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:129:in `sh'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:42:in `build_gem'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:53:in `install_gem'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:31:in `block in install'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
c:/Ruby192/bin/rake:31:in `<main>'
但是,文件 c:/Users/carona/Desktop/redcloth/redcloth.gemspec
实际上确实存在,所以我有不知道该怎么做。
Context
I've recently taken part of a software development project for which I'd like technical documents to be written using a textual markup (suitable to be tracked in the code repository, alongside the code). Because the project is already using Redmine, I'd like to use Textile thus avoiding other developers to learn Yet Another Markup Language. I know implementations vary somewhat, so in the spirit of POLS, I would like to use RedCloth, which is used internally by Redmine.
We are developping on and deploying to multiple OSes, including Windows. For lots of convenience, as well as non-technical, non-developer users using Windows only I'd like to be able to compile said technical documents using a standalone tool, preferably deployed as a single installer.
I'm 100% new to Ruby, so please be patient. I don't plan on developing in Ruby for this project, I just want a working install on Windows, I'll take care of the rest from there.
Help wanted
I'm not developing a Rails application and this is for desktop installation, so don't tell me to "just use it on Linux". I have installed the DevKit which installs make
, g++
etc. and is accepted by ./configure
scripts as a "sane development environment".
I have a simple problem and I'm looking for a simple solution. Googling this problem has shown this problem to has been reported before and I've only found recommendations to switch to Linux, and people that tell me it "just works as advertised".
I'd like some actual help, please, even if it's only in the form of a checklist of possible failure points that I can check.
Environment
This problem occurs on Windows 7, 64-bit machines with no prior history of Ruby installation. I don't have access to a 32-bit at the moment.
Linux installs are not a problem.
Problem
I've just downloaded the Ruby Installer for Windows Ruby 1.9.2-p136
, and the Ruby Development Kit DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe
, which is required for compiling RedCloth. Both are the current recommended versions for deploying Ruby on Windows at the moment (or so I've read).
I'm following instructions, and so far so good. Both Ruby and the DevKit are installed in the default paths (no spaces in folder names). config.yml
correctly points to the new install and nothing else. ruby dk.rb install
runs fine. I can now see, in the Ruby installation folder, a file called lib/ruby/site_ruby/devkit.rb
that is, I presume, the compilation pre-hook that sets the path to the DevKit when compiling Ruby gems. The code points to the correct folders, as expected.
When I test the installation with the recommended gem install rdiscount --platform=ruby
command, I get this:
C:\DevKit>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:/Ruby192/bin/ruby.exe" extconf.rb
This is a little confusing, so I started looking around and I can find the file lib/ruby/gems/1.9.1/gems/rdiscount-1.6.5/ext/extconf.rb
file. Running it through ruby extconf.rb
in that folder gives me:
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:/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:/Ruby192/lib/ruby/1.9.1/mkmf.rb:678:in `flush': Broken pipe (Errno::EPIPE)
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:678:in `message'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:690:in `checking_for'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'
I have read somewhere (can't find a link to it right now) that rdiscount
doesn't compile on Windows, so I've proceeded with fetching the source code for RedCloth from the source repository (git clone git://github.com/jgarber/redcloth.git
), as instructed.
When I try rake install
from the given directory, I get errors for missing gems (diff-lcs
and others), so I install them using gem install diff-lcs --version '=...'
and then I can start the real installation.
When I get there, rake
fails the following message:
(in c:/Users/carona/Desktop/redcloth)
rake aborted!
No such file or directory - gem build c:/Users/carona/Desktop/redcloth/redcloth.gemspec 2>&1
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:138:in ``'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:138:in `block in sh_with_code'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:137:in `chdir'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:137:in `sh_with_code'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:129:in `sh'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:42:in `build_gem'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:53:in `install_gem'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.8/lib/bundler/gem_helper.rb:31:in `block in install'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
c:/Ruby192/bin/rake:31:in `<main>'
However, the file c:/Users/carona/Desktop/redcloth/redcloth.gemspec
actually does exist, so I have no idea how to go about this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将问题归结为两件事,第二件事是我的“错误”。
gem install RedCloth
,这导致一些路径被转换为/C/...
而不是C:/
> 在 Makefile 中。显然,g++
和朋友无法打开任何给定的文件。通过从cmd.exe
运行ruby
和gem
重新安装已经解决了所有问题。我现在安装得很愉快。我还向 RubyInstaller 团队报告了第一个问题。
I've tracked the problem down to two things, the 2nd of which is my "mistake".
gem install RedCloth
and this caused some paths to be translated to/C/...
instead ofC:/
inside the Makefile. Obviously,g++
and friends could not open any of the given files. Re-installing by runningruby
andgem
fromcmd.exe
has fixed all the problems.I now have a happy install. I've also reported the 1st issue to the RubyInstaller team.