gpt4 book ai didi

ruby-on-rails - 在 cygwin 中安装 Rails 时遇到问题

转载 作者:数据小太阳 更新时间:2023-10-29 08:48:44 25 4
gpt4 key购买 nike

I'm trying to figure Ruby on Rails in cygwin, and I;ve used the native cygwin installer, however I get this error message when I try
$ gem install rails. I've also tried another route with RailInstaller and but I don't think Cygwin can locate the correct path.

//错误信息 构建 native 扩展。这可能需要一段时间... 错误:安装 rails 时出错: 错误:无法构建 gem native 扩展。

        /usr/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
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}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/usr/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /usr/lib/ruby/1.9.1/mkmf.rb:712:in `try_run'
from extconf.rb:26:in `<main>'


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/atomic-1.1.14 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/atomic-1.1.14/ext/gem_make.out

//这是makefile文件,会不会是我没有合适的gcc?

"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-cygwin -I/usr/include/ruby-1.\
9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -ggdb -O2 -pipe -fno-stric\
t-aliasing conftest.c -L. -L/usr/lib -L. -lruby191 -lpthread -lrt -ldl \
-lcrypt "
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: cannot\
find -lcrypt
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */


**Thanks a bunch!**

最佳答案

ld -lcrypt --verbose (失败的命令是:ld -lcrypt)

要求: (西类牙语表示在那里没有找到任何东西)

    falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.dll.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.dll.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.lib
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.dll
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.dll
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.a
falló el intento de abrir /usr/lib/libcrypt.dll.a
falló el intento de abrir /usr/lib/crypt.dll.a
falló el intento de abrir /usr/lib/libcrypt.a
falló el intento de abrir /usr/lib/crypt.lib
falló el intento de abrir /usr/lib/libcrypt.dll
falló el intento de abrir /usr/lib/crypt.dll
falló el intento de abrir /usr/lib/libcrypt.a
falló el intento de abrir /usr/lib/w32api/libcrypt.dll.a
falló el intento de abrir /usr/lib/w32api/crypt.dll.a
falló el intento de abrir /usr/lib/w32api/libcrypt.a
falló el intento de abrir /usr/lib/w32api/crypt.lib
falló el intento de abrir /usr/lib/w32api/libcrypt.dll
falló el intento de abrir /usr/lib/w32api/crypt.dll
falló el intento de abrir /usr/lib/w32api/libcrypt.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.dll.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.dll.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.a
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.lib
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/libcrypt.dll
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.dll
falló el intento de abrir /usr/x86_64-pc-cygwin/lib/crypt.lib
falló el intento de abrir /usr/lib/libcrypt.dll.a
falló el intento de abrir /usr/lib/crypt.dll.a
falló el intento de abrir /usr/lib/libcrypt.a
falló el intento de abrir /usr/lib/crypt.lib
falló el intento de abrir /usr/lib/libcrypt.dll
falló el intento de abrir /usr/lib/crypt.dll
falló el intento de abrir /usr/lib/crypt.lib
falló el intento de abrir /usr/lib/w32api/libcrypt.dll.a
falló el intento de abrir /usr/lib/w32api/crypt.dll.a
falló el intento de abrir /usr/lib/w32api/libcrypt.a
falló el intento de abrir /usr/lib/w32api/crypt.lib
falló el intento de abrir /usr/lib/w32api/libcrypt.dll
falló el intento de abrir /usr/lib/w32api/crypt.dll
falló el intento de abrir /usr/lib/w32api/crypt.lib
ld: no se puede encontrar -lcrypt

$ find/-type f -name 'libcrypt*' 2>/dev/null

(2>/dev/null 删除 Windows 文件夹的权限错误消息)

导致: (相关行)

    /lib/w32api/libcrypt32.a
/lib/w32api/libcryptdlg.a
/lib/w32api/libcryptdll.a
/lib/w32api/libcryptext.a
/lib/w32api/libcryptnet.a
/lib/w32api/libcryptsp.a
/lib/w32api/libcryptsvc.a
/lib/w32api/libcryptui.a
/lib/w32api/libcryptxml.a
/usr/lib/w32api/libcrypt32.a
/usr/lib/w32api/libcryptdlg.a
/usr/lib/w32api/libcryptdll.a
/usr/lib/w32api/libcryptext.a
/usr/lib/w32api/libcryptnet.a
/usr/lib/w32api/libcryptsp.a
/usr/lib/w32api/libcryptsvc.a
/usr/lib/w32api/libcryptui.a
/usr/lib/w32api/libcryptxml.a

所以,符号链接(symbolic link):

ln -s/lib/w32api/libcrypt32.a/lib/w32api/libcrypt.a

...成功了。 qed.

关于ruby-on-rails - 在 cygwin 中安装 Rails 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19410854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com