Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 安装了rbenv的ruby上的分段错误_Ruby On Rails_Ruby_Bundler_Rbenv_Osx Yosemite - Fatal编程技术网

Ruby on rails 安装了rbenv的ruby上的分段错误

Ruby on rails 安装了rbenv的ruby上的分段错误,ruby-on-rails,ruby,bundler,rbenv,osx-yosemite,Ruby On Rails,Ruby,Bundler,Rbenv,Osx Yosemite,我在rails应用程序中使用ruby 1.9.3。我在OSX Yosemite上成功地使用rbenv和GCC4.2安装了ruby,并且可以使用bundler安装依赖项 尝试设置数据库时,出现以下错误: bundle exec rake db:setup foo already exists foo_test already exists ruby(31773,0x7fff79ac7300) malloc: *** error for object 0x7fe00a8c0dc8: incorrec

我在rails应用程序中使用ruby 1.9.3。我在OSX Yosemite上成功地使用rbenv和GCC4.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
$bundle exec rake db:setup
--创建_表(“foo”,{:force=>true})
->0.0241s
...
--创建_表(“bar”,{:force=>true})
->0.0241s
/Users/jedi/code/foo/.bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active\u record/migration.rb:601:[BUG]分段错误
ruby 1.9.3p484(2013-11-22修订版43786)[x86_64-darwin14.3.0]
--控制帧信息-----------------------------------------------
c:0062 p:0012 s:0220 b:0220 l:000219 d:000219方法/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:0060p:0005s:0212b:0212l: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级别回溯信息----------------------------------------
/Users/jedi/code/foo/.bundle/ruby/1.9.1/bin/rake:23:in`'
/Users/jedi/code/foo/.bundle/ruby/1.9.1/bin/rake:23:in'load'
...
[注]
您可能在Ruby解释器或扩展库中遇到错误。
欢迎提供Bug报告。
详情如下:http://www.ruby-lang.org/bugreport.html

我尝试升级到ruby 2.0.0,并使用clang编译ruby,但结果总是一样。有什么想法吗?

这是由于计算机上安装的zeromq版本不正确造成的。我们使用的gem目标是zeromq 3,但安装了版本4

经过一些二进制搜索,我从文件中删除并添加依赖项,得出了这个结论。降级zeromq完成了任务


对我来说,错误报告为什么会如此误导我仍然是个谜,但问题已经解决。

还尝试用rvm安装ruby。同样的结果。您使用的是ruby 1.9.3p484,您能用ruby 1.9.3p551试试您的代码吗?您的代码在不同的操作系统上运行良好吗?例如,你可以使用vagrant将ubuntu安装在一个虚拟的盒子中进行测试。你已经尝试过增加补丁级别,但没有效果。即使在其他OSX Yosemite计算机上,该应用程序也运行良好。谢谢你介意把整个诊断都贴出来吗?(在spotlight中键入
console
,然后找到匹配的报告)。谢谢