版本
Mac操作系统:OSX 10.10.2
红宝石:2.2.1P85
栏杆:4.2.0
上下文
我正在关注www.install rails.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导致了问题?
如果你需要任何删除的信息,请告诉我。错误报告真的很长,所以我删除了代码,其中说了很多信息,这里列出的简洁。

最佳答案

根据@maxd的建议,我最终不得不卸载并重新安装ruby。
这是我遵循的流程。
我用命令行rvm remove 2.2.1卸载了ruby
我用命令行重新安装2.2.1rvm install 2.2.1
然后我用命令行重新安装了railssudo gem install rails
然后我用bundle install重新安装丢失的gems
接下来,我使用gem install rubygems-update将rubygems从2.0.14更新到2.1。
然后我用gem pristine --all将宝石重置为原始状态。
出于某种原因,我不得不重新运行bundle install,因为ActionMailer4.2.0不再显示为已安装,即使它在第一个bundle install之后的列表中。
最后,运行rails -v得到了Rails 4.2.0的输出,而不是错误代码。
所以,我跑了,一切都很好。

09-25 16:18
查看更多