7

我正在尝试在 Windows Vista 上安装bcrypt-ruby 。

到目前为止,我已经能够安装来自 MS 知识库文章的 nmake.exe 和安装 Visual Studio 2008 Express 的 cl.exe。

但是,我现在遇到了这个错误:

cl -nologo -Wall -I. -IC:/InstantRails/ruby/lib/ruby/1.8/i386-mswin32 -I
C:/InstantRails/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6  -c -Tcb crypt.c
cl : Command line warning D9035 : option 'Og-' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-G6' bcrypt.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(381) : warning C4255: '_get_printf_count_output' : no function prototype given: converting '()' to '(void)'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdlib.h(215) : warning C4255: '_get_purecall_handler' : no function prototype given: converting '()' to '(void)' 
c:\instantrails\ruby\lib\ruby\gems\1.8\gems\bcrypt-ruby-2.1.2\ext\mri\blf.h(37): fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.

我已经执行了大概设置环境的 VCVARS32.bat。我怀疑警告和错误是由于安装了较新版本的 Visual Studio。

有没有人成功做到这一点?我没有 Visual Studio 6.0 的副本。

4

7 回答 7

9

更好、最简单的方法是安装开发工具包

  1. devkit-<version>.7z这里下载;
  2. 将其解压缩到 Ruby 目录中(例如C:\RubyC:\Ruby\devkit
  3. 从命令行,键入:gem install bcrypt-ruby
于 2010-03-11T12:07:39.767 回答
2

对我来说,以下工作

gem uni bcrypt-ruby
gem i bcrypt-ruby --platform=ruby
于 2013-05-23T16:15:15.090 回答
1

为了能够为 One-Click Installer (OCI) 构建 gem 扩展,您需要 VC6。混合和匹配不同版本的较新 Visual Studio 将失败或在运行时生成未知错误。

我建议避免所有这些麻烦并继续使用 One-Click 的继任者,称为 RubyInstaller。

  1. 下载并安装 1.8.6 或 1.9.1 RC1 包,在 RubyForge 上宣布
  2. 下载开发工具包,并在您的 Ruby 安装中解压它
  3. 按照INSTALL.txt说明将 DevKit 调整到您提取它的位置
  4. 继续gem install bcrypt-ruby,将开箱即用

有关在此较新版本中使用其他 gem 或 Rails 的更多详细信息,请参阅我们 Wiki 中的教程部分。

希望这可以帮助。

于 2009-11-22T15:26:18.333 回答
1

试试下面的命令

宝石安装 bcrypt-ruby --platform=mswin32

于 2010-09-22T21:01:04.627 回答
0

我在 Windows 中安装设备时遇到了同样的问题。

也许你可以看看这个:http: //github.com/oneclick/rubyinstaller/wiki/development-kit

而且giorgian是正确的,请注意:

  1. ruby 版本:您必须安装“ruby 安装程序”版本,但不能安装 .zip 版本或其他版本。

  2. 将其解压缩到 Ruby 目录(例如 C:\Ruby,这样您将拥有 C:\Ruby\devkit;

  3. 如果您从其他安装文件(不是 ruby​​-installer)安装 ruby​​,则必须删除它,然后使用 ruby​​ 安装程序安装 ruby​​。不要简单地覆盖它。

  4. 无需安装 VC6,它不适用于其他 ruby​​ 安装版本(不是 ruby​​-installer)。如果你安装它只是为了设置 ruby​​-gem,我建议你删除它。

  5. 无需安装 MinGW ,因为 dev-kit 是基于它的。

我花了将近 15 个小时来解决这个问题。现在是时候说“ruby-installer”+“dev kit”是我们构建原生 gem 的选择了。

于 2010-10-10T23:18:11.427 回答
0

在 Windows Server 2003 (Ruby 1.8.6) 上,普通的香草:

gem install bcrypt-ruby

像魅力一样工作。
注意,如果你想在 Rails 中使用它,你必须使用:

config.gem 'bcrypt-ruby', :lib => 'bcrypt'
于 2011-02-23T05:35:55.120 回答
0

对我来说,部分问题在于我安装了 Ruby2.0.0 x64(我正在运行 win8),这似乎与我使用的 gcc 编译器不兼容。

我已经删除了我的 ruby​​ 安装,并使用 railsInstaller ( http://railsinstaller.org/ )安装了 ruby​​ 1.9.3 以及 Bundler、Rails 和其他一些软件包,现在我可以安装 bcrypt-ruby :)

于 2013-04-30T13:52:55.957 回答