【问题标题】:Error running Rails server on OS 10.10.2在 OS 10.10.2 上运行 Rails 服务器时出错
【发布时间】:2015-03-17 06:43:07
【问题描述】:

版本

Mac 操作系统:OSX 10.10.2
红宝石:2.2.1p85
导轨:4.2.0

上下文

我正在关注 www.installrails.com 上的“安装 Rails”教程。在遇到许多错误后终于通过了。我正在创建示例应用程序的最后一步,它运行良好,然后运行服务器。现在,我遇到了另一个错误。

错误

这是我所看到的:

/Users/Work/.rvm/gems/ruby-2.2.1/gems/json-1.8.2/lib/json/ext/parser.bundle: [BUG] Segmentation fault at 0x00000000000418
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]

-- Crash Report log information --------------------------------------------

See Crash Report log file under the one of following:

     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------

*A lot of information listed here*

-- Ruby level backtrace information ----------------------------------------

*A lot of information listed here*

-- Machine register context ------------------------------------------------

*A lot of information listed here*

-- C level backtrace information -------------------------------------------


*A lot of information listed here*

-- Other runtime information -----------------------------------------------

* Loaded script: bin/rails

* Loaded features:

*And then a long list of files listed here*

[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

帮助

现在,我想知道是不是 json gem 导致了问题?

如果您需要任何已删除的信息,请告诉我。错误报告真的很长,所以为了简洁起见,我删除了 此处列出了很多信息 的代码。

【问题讨论】:

  • 尝试从rvm 中删除所有2.2.1 ruby​​ 版本并重新安装最新版本。
  • 我遇到了完全相同的问题:

标签: ruby-on-rails ruby json


【解决方案1】:

根据@maxd 的建议,我最终不得不卸载并重新安装 ruby​​。

这是我遵循的过程。

  1. 我用命令行rvm remove 2.2.1卸载了Ruby
  2. 我用命令行rvm install 2.2.1重新安装2.2.1
  3. 然后我用命令行sudo gem install rails重新安装了rails
  4. 然后我使用bundle install 重新安装丢失的gem
  5. 接下来,我使用gem install rubygems-update 将 Rubygems 从 2.0.14 更新到 2.1。
  6. 然后我使用gem pristine --all 将宝石重置为原始状态。
  7. 然后由于某种原因我不得不重新运行bundle install,因为actionmailer 4.2.0 不再显示为已安装,即使它在第一个bundle install 之后的列表中。
  8. 最终运行rails -v 给了我Rails 4.2.0 的输出而不是错误代码。

所以,我跑了rails server,一切都很好。

【讨论】:

    【解决方案2】:

    我解决了这个问题。但我不确定这是一个好方法。

    首先,我重新安装了 ruby​​。因为,我看起来像我看到的版本问题。

    rvm reinstall all

    gem install rails。在这个过程之后,我可以使用rails server 命令运行服务器。

    我希望这也能成为您的解决方案。祝你有美好的一天:D

    【讨论】:

      【解决方案3】:

      我在我的 mac mini(M1) 中遇到了同样的问题。在the developer forum.中找到的以下解决方案对我有用

      sudo arch -x86_64 gem install ffi
      
      Then
      
      arch -x86_64 pod install
      

      【讨论】:

        猜你喜欢
        • 2014-10-31
        • 2018-07-07
        • 2012-07-31
        • 2013-03-22
        • 1970-01-01
        • 2015-05-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多