簡體   English   中英

使用 rbenv 安裝的 ruby​​ 出現分段錯誤

[英]Segmentation fault on ruby installed with rbenv

我在 Rails 應用程序中使用 ruby​​ 1.9.3。 我在 OSX Yosemite 上使用 rbenv 和 gcc 4.2 成功安裝了 ruby​​,並且可以使用 bundler 安裝依賴項。

當我嘗試設置數據庫時,出現以下錯誤:

bundle exec rake db:setup
foo already exists
foo_test already exists
ruby(31773,0x7fff79ac7300) malloc: *** error for object 0x7fe00a8c0dc8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
[1]    31773 abort      bundle exec rake db:setup

第一次后,我收到不同的錯誤消息:

$ bundle exec rake db:setup
-- create_table("foo", {:force=>true})
   -> 0.0241s
...
-- create_table("bar", {:force=>true})
   -> 0.0241s
/Users/jedi/code/foo/.bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:601: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin14.3.0]

-- Control frame information -----------------------------------------------
c:0062 p:0012 s:0220 b:0220 l:000219 d:000219 METHOD /Users/jedi/code/foo/.bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:601
c:0061 p:0071 s:0216 b:0214 l:000195 d:000213 BLOCK  /Users/jedi/code/foo/.bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:461
c:0060 p:0005 s:0212 b:0212 l:000201 d:000211 BLOCK  /Users/jedi/code/foo/.bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/migration.rb:438
...
-- Ruby level backtrace information ----------------------------------------
/Users/jedi/code/foo/.bundle/ruby/1.9.1/bin/rake:23:in `<main>'
/Users/jedi/code/foo/.bundle/ruby/1.9.1/bin/rake:23:in `load'
...
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

我嘗試更新到 ruby​​ 2.0.0 並使用 clang 編譯 ruby​​,但總是一樣。 有任何想法嗎?

這是由於計算機上安裝的 zeromq 版本不正確造成的。 我們使用的是針對 zeromq 3 但安裝了版本 4 的 gem。

在從 Gemfile 中刪除並添加依賴項后,我得出了這個結論。 降級 zeromq 完成了這項工作。

對我來說,為什么錯誤報告如此具有誤導性仍然是一個謎,但問題已解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM