5

Windows上のRubyonRails3.1用にPublifyWebブログCMS6.0.9をインストールしようとしています。

bundle install Publifyを実行しようとするたびに、blueclothgemをインストールするときに同じエラーメッセージが表示されます。

C:\Users\Lunasea\Downloads\typo-6.0.9>gem install bluecloth
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing bluecloth:
        ERROR: Failed to build gem native extension.

        C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
checking for srand()... yes
checking for random()... no
checking for rand()... yes
checking for bzero() in string.h,strings.h... no
checking for strcasecmp()... yes
checking for strncasecmp()... yes
checking for mkdio.h... yes
checking for ruby/encoding.h... yes
creating extconf.h
creating Makefile

make
C:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_bluecloth_ext'"
> bluecloth_ext-i386-mingw32.def
gcc -I. -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32 -I/C/Rails
Installer/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/RailsInstaller/Ruby1.9
.2/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\"    -DVERSION=\"2.0.9\"
-O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-st
rings -Wno-missing-field-initializers -Wno-long-long -I.  -o bluecloth.o -c blue
cloth.c
In file included from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.
1/../../../../include/windows.h:48:0,
                 from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.
1/../../../../include/winsock2.h:22,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/win32.
h:33,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/define
s.h:205,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/ruby.h
:74,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby.h:32,
                 from bluecloth.h:14,
                 from bluecloth.c:25:
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:229:23: error: duplicate 'unsigned'
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: duplicate 'unsigned'
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: two or more data types in declaration specifiers
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:241:24: error: duplicate 'unsigned'
make: *** [bluecloth.o] Error 1


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9
.1/gems/bluecloth-2.2.0 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bluecloth
-2.2.0/ext/gem_make.out

私はすでにgemを単独でインストールするか、単に最新バージョンをインストールしようとしましたが、常に同じ結果が得られます。

標準で生成されたdatabase.ymlを使用しています。

4

2 に答える 2

5

2.2.0 のヘッダー ファイルにより、windows での bluecloth のコンパイルが妨げられます。ただし、自分でパッチを適用できます。

  1. まだ実行gem install bluecloth -v '2.2.0'していない場合は実行します

  2. このパッチをファイルに適用しbluecloth.hます。私のマシンでは、次の場所にあります。

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h

  3. たとえば、bluecloth 2.2.0 ディレクトリに移動します。

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

  4. 実行しますrake gem(追加の gem をインストールする必要がある場合があります)。

    次に、作成された .gem ファイルが表示されます。

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

  5. このディレクトリを開き、パッチを適用した gem をインストールします。

    gem install bluecloth-2.2.0.gem --platform=ruby

于 2012-11-24T18:12:49.620 に答える
2

Windows は Rails を実行するのに最適な環境ではありません。これは良い例です。詳細については、このリンクを参照してください。

于 2012-01-13T09:05:36.040 に答える