如何在Cygwin中使用rails

时间:2009-10-27 17:56:54

标签: ruby-on-rails cygwin

我已经使用rubystack安装了rails并设置了env路径,所以我可以在cmd中使用它。当我尝试将它与cygwin一起使用时,我无法工作(它不应该),如何使这个轨道在windows和cygwin env上工作,或者我必须单独安装它。

3 个答案:

答案 0 :(得分:0)

如果您只是想安装以便可以在cmd中使用它,那么您可以在不使用Cygwin的情况下执行此操作。您可以在Windows中下载并安装ruby和rubygems,然后使用rubygems安装rails和您需要的任何其他宝石。然后,您必须正确设置路径以包含ruby安装的bin目录,并且您应该能够在Windows中使用cmd中的ruby。这并不直接回答我所知道的问题,但如果你只是在cmd中寻找rails,我希望它有用。

答案 1 :(得分:0)

更新:我发现有两个问题解决了我在下面列出的问题。

首先

  • 运行Cygwin的setup.exe并搜索“make”
  • 等待搜索结果
  • 安装所有出现的项目(您可以通过点击“树”顶部附近来执行此操作)

其次

  • 运行Cygwin的setup.exe并安装rebase包。
  • 使用Windows cmd行(是的,它必须是Windows cmd行而不是cygwin!),运行\cygwin\bin\ash
  • 在灰烬提示下,运行/bin/rebaseall

重新启动Windows。运行cygwin。运行:gem install rails


我已经通过cygwin安装文件安装了Ruby。我还安装了“make”,“sqlite”和“openssl / openssh”。

然后我通过从网站下载,cd进入/ cygwin / bin /然后进入临时目录然后运行ruby setup.rb成功安装了Gems。

这一切都完美安装。

现在我运行gem install rails。它无法产生以下错误。我找不到更多关于此的信息。任何帮助非常感谢。

gem install rails
cygwin warning:
  MS-DOS style path detected: C:\ProgramData/gemrc
  Preferred POSIX equivalent is: /cygdrive/c/ProgramData/gemrc
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Building native extensions.  This could take a while...
      0 [main] ruby 524 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x330000
      0 [main] ruby 524 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x330000
Stack trace:
Frame     Function  Args
023FAEF8  6102796B  (023FAEF8, 00000000, 00000000, 00000000)
      1 [main] ruby 2736 fork: child 524 - died waiting for dll loading, errno 11
023FC218  61004F1B  (611A7FAC, 61243684, 00230000, 00330000)
End of stack trace
      1 [main] ruby 2736 fork: child 524 - died waiting for dll loading, errno 11
1049214 [main] ruby 6948 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x3D0000
1049214 [main] ruby 6948 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x3D0000
Stack trace:
Frame     Function  Args
023FAEF8  6102796B  (023FAEF8, 00000000, 00000000, 00000000)
023FB1E8  6102796B  (6117EC60, 00008000, 00000000, 61180977)
023FC218  61004F1B  (611A7FAC, 61243684, 001055653 [main] ruby 2736 fork: child 6948 - died waiting for dll loading, errno 11
230000, 003D0000)
End of stack trace
1055653 [main] ruby 2736 fork: child 6948 - died waiting for dll loading, errno 11
2095819 [main] ruby 6924 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x360000
2095819 [main] ruby 6924 C:\cygwin\bin\ruby.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\ruby\1.8\i386-cygwin\etc.so to same address as parent: 0x230000 != 0x360000
Stack trace:
Frame     Function  Args
023FAEF8  6102796B  (023FAEF8, 00000000, 00000000, 00000000)
023FB1E8  6102796B  (6117EC60, 00008000, 00000000, 61180977)
023FC218  61004F1B  (611A7FAC, 61243684, 00230000, 00360000)2103039 [main] ruby 2736 fork: child 6924 - died waiting for dll loading, errno
11

End of stack trace
2103039 [main] ruby 2736 fork: child 6924 - died waiting for dll loading, errno 11
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby.exe extconf.rb
creating Makefile

make
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I.   -g -O2    -c bcrypt_ext.c
make: gcc: Command not found
make: *** [bcrypt_ext.o] Error 127


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out

对于您的信息,我的红宝石和宝石版本如下:

$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

$ gem -v
1.8.10

答案 2 :(得分:-1)

请访问此网站:

http://www.pluitsolutions.com/2006/03/30/install-ruby-on-rails-ror-on-cygwin

但是,如果您有其他问题,请发表评论,我们会看看。