OSX上的Ruby nubie-无法超越rake db:migrate-出现[BUG]总线错误 [英] Ruby nubie on OSX - can't get beyond rake db:migrate - get [BUG] Bus Error
问题描述
原始问题:
我是(红宝石的新手)使用RVM在Mac OSX 10.6上管理我的红宝石
I'm (a newbie to ruby) using RVM to manage my ruby on Mac OSX 10.6
这是我的mac OX信息:
Here's my mac OX info:
$ rvm info
ruby-1.9.2-head@1.9.2-head-gemset:
system:
uname: "Darwin fillibuster-2.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (i386-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.5.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.9.2p188"
date: "2011-03-28"
platform: "i386-darwin10.6.0"
patchlevel: "2011-03-28 revision 31204"
full_version: "ruby 1.9.2p188 (2011-03-28 revision 31204) [i386-darwin10.6.0]"
homes:
gem: "/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@1.9.2-head-gemset"
ruby: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head"
binaries:
ruby: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/bin/ruby"
irb: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/bin/irb"
gem: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/bin/gem"
rake: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/bin/rake"
environment:
PATH: "/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@1.9.2-head-gemset/bin:/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@global/bin:/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/bin:/Users/dawnbuie/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
GEM_HOME: "/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@1.9.2-head-gemset"
GEM_PATH: "/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@1.9.2-head-gemset:/Users/dawnbuie/.rvm/gems/ruby-1.9.2-head@global"
MY_RUBY_HOME: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head"
IRBRC: "/Users/dawnbuie/.rvm/rubies/ruby-1.9.2-head/.irbrc"
RUBYOPT: ""
gemset: "1.9.2-head-gemset"
这是我安装的gem版本
Here are my installed gem versions
$ gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.6)
actionpack (3.0.6)
activemodel (3.0.6)
activerecord (3.0.6)
activeresource (3.0.6)
activesupport (3.0.6)
arel (2.0.9)
builder (2.1.2)
bundler (1.0.11)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.15)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.6)
railties (3.0.6)
rake (0.8.7)
sqlite3-ruby (1.3.2)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.26)
我正在跟踪一个教程,试图了解实际的Rails构建部分,我很好到这里:
I'm following a tutorial trying to get to the actual rails building part, and I'm fine up to here:
$ rails generate scaffold User name:string email:string
,但是当我键入此命令时,不断出现以下错误:
but am constantly getting the following error when I type this:
$ rake db:migrate
我不知道问题是否出在sqlite3或ruby 1.9.2p180-我尝试使用Google查找此错误,而这就是我想出的所有内容 https://redmine.ruby-lang.org/attachments/1505/ruby-1.9.2-bug.txt
I don't know if the problem is the version of sqlite3, or ruby 1.9.2p180 - I've tried looking for this error using google and this is all I come up with https://redmine.ruby-lang.org/attachments/1505/ruby-1.9.2-bug.txt
我不知道如何解释以下错误,因为我只是想弄清楚所有部分如何组合在一起。
I don't know how to interpret the errors below as I'm just figuring out how all the pieces fit together.
谢谢对于任何指针或帮助确定错误的来源
thank you for any pointers or help identifying the source of the error
错误消息:
$ rake db:migrate --trace
(in /Users/bobstuff/Documents/Projects/rubyonrails/rails_projects/first_app)
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3/sqlite3_native.bundle: [BUG] Bus Error
ruby 1.9.2p180 (2011-02-18 revision 30909) [i386-darwin10.6.0]
-- control frame ----------
c:0029 p:-7277696 s:0087 b:0087 l:000086 d:000086 TOP
c:0028 p:---- s:0085 b:0085 l:000084 d:000084 CFUNC :require
c:0027 p:0029 s:0081 b:0081 l:000077 d:000080 BLOCK /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3.rb:6
c:0026 p:0035 s:0078 b:0078 l:000077 d:000077 TOP /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3.rb:2
c:0025 p:---- s:0076 b:0076 l:000075 d:000075 FINISH
c:0024 p:---- s:0074 b:0074 l:000073 d:000073 CFUNC :require
c:0023 p:0026 s:0070 b:0070 l:000051 d:000069 BLOCK /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:68
c:0022 p:---- s:0067 b:0067 l:000066 d:000066 FINISH
c:0021 p:---- s:0065 b:0065 l:000064 d:000064 CFUNC :each
c:0020 p:0091 s:0062 b:0062 l:000051 d:000061 BLOCK /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:66
c:0019 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0018 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC :each
c:0017 p:0046 s:0052 b:0052 l:000051 d:000051 METHOD /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:55
c:0016 p:0021 s:0048 b:0048 l:000047 d:000047 METHOD /Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler.rb:120
c:0015 p:0079 s:0044 b:0044 l:000043 d:000043 TOP /Users/bobstuff/Documents/Projects/rubyonrails/rails_projects/first_app/config/application.rb:7
c:0014 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0013 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :require
c:0012 p:0013 s:0036 b:0036 l:000035 d:000035 METHOD <internal:lib/rubygems/custom_require>:29
c:0011 p:0026 s:0031 b:0031 l:000030 d:000030 TOP /Users/bobstuff/Documents/Projects/rubyonrails/rails_projects/first_app/Rakefile:4
c:0010 p:---- s:0029 b:0029 l:000028 d:000028 FINISH
c:0009 p:---- s:0027 b:0027 l:000026 d:000026 CFUNC :load
c:0008 p:0334 s:0023 b:0023 l:000022 d:000022 METHOD /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2373
c:0007 p:0009 s:0018 b:0018 l:000011 d:000017 BLOCK /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2007
c:0006 p:0009 s:0016 b:0016 l:000015 d:000015 METHOD /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2058
c:0005 p:0011 s:0012 b:0012 l:000011 d:000011 METHOD /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2006
c:0004 p:0021 s:0009 b:0009 l:000008 d:000008 METHOD /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1991
c:0003 p:0139 s:0006 b:0006 l:000b74 d:000ed4 EVAL /Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/bin/rake:35
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000b74 d:000b74 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/bin/rake:35:in `<main>'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1991:in `run'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/Users/bobstuff/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2373:in `load'
/Users/bobstuff/Documents/Projects/rubyonrails/rails_projects/first_app/Rakefile:4:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/Users/bobstuff/Documents/Projects/rubyonrails/rails_projects/first_app/config/application.rb:7:in `<top (required)>'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler.rb:120:in `require'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in `require'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in `each'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in `block in require'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in `each'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in `require'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3.rb:2:in `<top (required)>'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3.rb:6:in `rescue in <top (required)>'
/Users/bobstuff/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3/lib/sqlite3.rb:6:in `require'
-- C level backtrace information -------------------------------------------
0 libruby.1.9.1.dylib 0x00195ca6 rb_vm_bugreport + 230
1 libruby.1.9.1.dylib 0x0003f03f report_bug + 415
2 libruby.1.9.1.dylib 0x0003f0eb rb_bug + 43
3 libruby.1.9.1.dylib 0x0010df4b sigbus + 27
4 libSystem.B.dylib 0x97b8246b _sigtramp + 43
5 ??? 0xffffffff 0x0 + 4294967295
6 libruby.1.dylib 0x00754f27 rb_intern + 62
7 libruby.1.dylib 0x0070b7b2 rb_define_module + 32
8 sqlite3_native.bundle 0x004f160f Init_sqlite3_native + 27
9 libruby.1.9.1.dylib 0x00004bd4 dln_load + 244
10 libruby.1.9.1.dylib 0x001791cb rb_vm_call_cfunc + 187
11 libruby.1.9.1.dylib 0x000462fe rb_require_safe + 1022
12 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
13 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
14 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
15 libruby.1.9.1.dylib 0x00184fd6 rb_iseq_eval + 358
16 libruby.1.9.1.dylib 0x00044f35 rb_load_internal + 293
17 libruby.1.9.1.dylib 0x00046332 rb_require_safe + 1074
18 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
19 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
20 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
21 libruby.1.9.1.dylib 0x0019231c rb_yield + 604
22 libruby.1.9.1.dylib 0x0000ac6e rb_ary_each + 62
23 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
24 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
25 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
26 libruby.1.9.1.dylib 0x0019231c rb_yield + 604
27 libruby.1.9.1.dylib 0x0000ac6e rb_ary_each + 62
28 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
29 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
30 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
31 libruby.1.9.1.dylib 0x00184fd6 rb_iseq_eval + 358
32 libruby.1.9.1.dylib 0x00044f35 rb_load_internal + 293
33 libruby.1.9.1.dylib 0x00046332 rb_require_safe + 1074
34 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
35 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
36 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
37 libruby.1.9.1.dylib 0x00184fd6 rb_iseq_eval + 358
38 libruby.1.9.1.dylib 0x00044f35 rb_load_internal + 293
39 libruby.1.9.1.dylib 0x00046918 rb_f_load + 136
40 libruby.1.9.1.dylib 0x00175835 call_cfunc + 581
41 libruby.1.9.1.dylib 0x00191010 vm_call_method + 944
42 libruby.1.9.1.dylib 0x0017a845 vm_exec_core + 5397
43 libruby.1.9.1.dylib 0x00184aed vm_exec + 1821
44 libruby.1.9.1.dylib 0x00184e47 rb_iseq_eval_main + 535
45 libruby.1.9.1.dylib 0x00042569 ruby_exec_internal + 153
46 libruby.1.9.1.dylib 0x00044aca ruby_run_node + 90
47 ruby 0x00001f1f main + 95
48 ruby 0x00001eb5 start + 53
[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
Abort trap
编辑:找到答案:
问题是我使用的是旧的(2007!)mac架构-MacBook Core Duo(不要与Core 2 Duo混淆),它是32位,不是当前的64位,并且是最新版本的sqlite3 在本教程中推荐(宝石'sqlite3-ruby',:require =>' sqlite3')不适用于我的其他Gems。我卸载了sqlite,
The problem was I was using an old (2007!) mac architecture - MacBook Core Duo (not to be confused with Core 2 Duo) which is 32 bit, NOT current 64 bit, and the current version of sqlite3 recommended in this tutorial (gem 'sqlite3-ruby', :require => 'sqlite3') did not work with the rest of my Gems. I uninstalled sqlite,
gem uninstall sqlite3 sqlite3-ruby
gem pristine --all // not sure if necessary, suggested in comments
将我的Gemfile编辑为:
edited my Gemfile to:
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
然后
Bundle install
rake db:migrate
即可!到目前为止。
我发现了乔什·克鲁斯(Josh Crews)的建议使用早期版本的sqlite3-即使他在Leopard上使用了红宝石1.8.7。
I found the suggestion by Josh Crews to use an earlier version of sqlite3 - even though he was using it on Leopard, with ruby 1.8.7.
推荐答案
请参阅问题顶部的答案。
See answer at top of question.
问题是我使用的是旧的(2007!)mac架构-MacBook Core Duo(不要与Core 2 Duo混淆),它是32位,不是当前的64位,并且是当前版本本教程中推荐的sqlite3中的一部分(gem'sqlite3-ruby',:require =>'sqlite3')不适用于我的其余Gems。我卸载了sqlite,
The problem was I was using an old (2007!) mac architecture - MacBook Core Duo (not to be confused with Core 2 Duo) which is 32 bit, NOT current 64 bit, and the current version of sqlite3 recommended in this tutorial (gem 'sqlite3-ruby', :require => 'sqlite3') did not work with the rest of my Gems. I uninstalled sqlite,
gem uninstall sqlite3 sqlite3-ruby
gem pristine --all // not sure if necessary, suggested in comments
将我的Gemfile编辑为:
edited my Gemfile to:
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
然后
Bundle install
rake db:migrate
即可!到目前为止,
我发现Josh Crews的建议是使用早期版本的sqlite3-即使他在Leopard上使用了Ruby 1.8.7。
I found the suggestion by Josh Crews to use an earlier version of sqlite3 - even though he was using it on Leopard, with ruby 1.8.7.
这篇关于OSX上的Ruby nubie-无法超越rake db:migrate-出现[BUG]总线错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!