gpt4 book ai didi

ruby-on-rails - OSX 上的 Ruby nubie - 无法超越 rake db :migrate - get [BUG] Bus Error

转载 作者:数据小太阳 更新时间:2023-10-29 08:29:06 25 4
gpt4 key购买 nike

原始问题:

我(ruby 的新手)使用 RVM 在 Mac OSX 10.6 上管理我的 ruby​​

这是我的 mac OX 信息:

$ 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 版本

$ 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 构建部分,我可以到这里:

$ rails generate scaffold User name:string email:string

但是当我输入这个时,我不断收到以下错误:

$ rake db:migrate

我不知道问题是 sqlite3 的版本还是 ruby​​ 1.9.2p180 - 我尝试使用 google 查找此错误,这就是我想出的全部 https://redmine.ruby-lang.org/attachments/1505/ruby-1.9.2-bug.txt

我不知道如何解释下面的错误,因为我只是弄清楚所有部分是如何组合在一起的。

感谢您的任何指点或帮助确定错误的来源

错误信息:

$ 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 架构 - 32 位的 MacBook Core Duo(不要与 Core 2 Duo 混淆),不是当前的 64 位,以及当前版本的 sqlite3 recommended in this tutorial (gem 'sqlite3-ruby', :require => 'sqlite3') 不适用于我的其他 Gems。我卸载了 sqlite,

gem uninstall sqlite3 sqlite3-ruby
gem pristine --all // not sure if necessary, suggested in comments

将我的 Gemfile 编辑为:

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

然后

Bundle install
rake db:migrate

而且有效!到目前为止。

我找到了 suggestion by Josh Crews使用早期版本的 sqlite3 - 即使他在 Leopard 上使用它,使用 ruby​​ 1.8.7。

最佳答案

请参阅问题顶部的答案。


问题是我使用的是旧的(2007 年!)mac 架构 - MacBook Core Duo(不要与 Core 2 Duo 混淆),它是 32 位的,不是当前的 64 位,并且是本文推荐的当前版本的 sqlite3 tutorial (gem 'sqlite3-ruby', :require => 'sqlite3') 不适用于我的其他 Gems。我卸载了 sqlite,

gem uninstall sqlite3 sqlite3-ruby
gem pristine --all // not sure if necessary, suggested in comments

将我的 Gemfile 编辑为:

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

然后

Bundle install
rake db:migrate

而且有效!到目前为止。

我发现 Josh Crews 建议使用早期版本的 sqlite3 - 即使他在 Leopard 上使用它,使用 ruby​​ 1.8.7。

关于ruby-on-rails - OSX 上的 Ruby nubie - 无法超越 rake db :migrate - get [BUG] Bus Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5575612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com