【问题标题】:Ruby 'rails server' issueRuby 'rails server' 问题
【发布时间】:2016-03-11 15:01:31
【问题描述】:

每次我尝试运行“rails server”时都会出错

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6

我已尝试遵循其他提示,例如捆绑安装和更新,但仍然存在同样的问题。尝试 rvm install 1.9.3 并得到:

Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: gcc49.......
Error running 'requirements_osx_brew_libs_install gcc49',
showing last 15 lines of /Users/Quoc/.rvm/log/1457707600_ruby-1.9.3-p551/package_install_gcc49.log
++ case "$1" in
++ [[ -t 1 ]]
++ return 1
++ printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ case "$_system_version" in
++ return 1
Requirements installation failed with status: 1.

Brew 修复也没有用。

编辑:运行brew install gcc46 --env=std的结果

==> make bootstrap
Last 15 lines from /Users/Quoc/Library/Logs/Homebrew/gcc46/02.make:
      _lto_end_uncompression in libbackend.a(lto-compress.o)
  "_inflateEnd", referenced from:
      _lto_end_uncompression in libbackend.a(lto-compress.o)
  "_inflateInit_", referenced from:
      _lto_end_uncompression in libbackend.a(lto-compress.o)
  "_zError", referenced from:
      _lto_end_compression in libbackend.a(lto-compress.o)
      _lto_end_uncompression in libbackend.a(lto-compress.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [cc1] Error 1
rm gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2

【问题讨论】:

    标签: ruby-on-rails ruby macos rvm


    【解决方案1】:

    你得手动安装这些依赖,试试

    brew install automake
    

    如果它给你这样的 automake 缺少链接的错误

    您必须brew link autoconf 才能安装 automake 然后尝试这些命令

    brew link --overwrite --dry-run autoconf
    
    brew link --overwrite autoconf
    
    brew install automake
    

    它将安装 automake,然后您可以再次尝试安装 ruby​​。

    如果不行,你可以试试别的方法:

    溶胶2:

    brew install gcc46 --env=std
    brew install gcc; brew install gcc46 --cc=gcc-4.9
    Manually build GCC 4.6 outside of Homebrew, using the same configure switches
    

    你也可以试试这个:

    $ brew install gcc
    $ CC=/usr/local/bin/gcc-4.9 rvm install 1.9.1-p376 --enable-shared
    

    【讨论】:

    • brew install automake 想出Warning: automake-1.15 already installed
    • 然后尝试其余的命令。让我知道它是否有效
    • 结果在我上面的编辑帖子中。是否值得完全卸载 brew 和 rails 以及与 ruby​​ 相关的所有内容并重新开始?如果是的话,你能给出命令吗
    • 最好重新开始。按照本教程moncefbelyamani.com/…
    • 是的。您首先需要卸载所有内容。
    猜你喜欢
    • 2012-08-30
    • 2016-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多