How to use rails within Cygwin
I have installed rails using rubystack and set env path, so I can use 开发者_JAVA百科it in cmd. When I try to use it with cygwin I doesn't work (it shouldn't), how to make this rails work on both windows and cygwin env or I have to install it separately.
If you are just looking to install so you can use it in cmd, then you can do this without having to use Cygwin. You can download and install ruby and rubygems in windows and then use rubygems to install rails and any other gems you need. You then just have to set the path properly to include the bin directory of the ruby installation and you should be able to use ruby from cmd in windows. This doesn't directly answer your questions I know, but if you are just looking for rails in the cmd, I hope it is helpful.
Update: I found two items which fixed the problem I outlined below.
Firstly
- Run Cygwin’s setup.exe and search for "make"
- Wait for search results
- Install all items which appear (you can do this by clicking near the top of the "tree")
Secondly
- Run Cygwin’s setup.exe and install the rebase package.
- Using the Windows cmd line (yes, it must be the Windows cmd line not cygwin!), run
\cygwin\bin\ash
- At the ash prompt, run
/bin/rebaseall
Restart Windows. Run cygwin. Run: gem install rails
I have installed Ruby via the cygwin setup file. I've also installed "make", "sqlite" and "openssl/openssh".
I've then sucessfully installed Gems by downloading from website, cd into /cygwin/bin/ and then into a temp directory and then running ruby setup.rb.
This all installed perfectly.
Now I run gem install rails
. It fails producing the following error. I can't find any more info on this. Any help much appreciated.
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
For your info my ruby and gem versions are below:
$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
$ gem -v
1.8.10
Please visit this site:
http://www.pluitsolutions.com/2006/03/30/install-ruby-on-rails-ror-on-cygwin
However, if you have a different issue leave a comment and we will have a look.
精彩评论