2010-08-06 109 views
15

试图让我的rails 3环境启动并运行,并且遇到一个错误,我无法避开。任何帮助将不胜感激!启动服务器时Rails分段错误?

这里的问题是:

Patrick-Scotts-MacBook-Pro:~ PJS$ cd hope_app 
Patrick-Scotts-MacBook-Pro:hope_app PJS$ rails server 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault 
ruby 1.9.2dev (2010-07-11 revision 28618) [x86_64-darwin10.4.0] 

-- control frame ---------- 
c:0026 p:-541019732 s:0075 b:0075 l:000074 d:000074 TOP 
c:0025 p:---- s:0073 b:0073 l:000072 d:000072 CFUNC :require 
c:0024 p:0029 s:0069 b:0069 l:000065 d:000068 BLOCK /Users/PJS/.rvm/gems/ruby-1.9.2- rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3.rb:6 
c:0023 p:0035 s:0066 b:0066 l:000065 d:000065 TOP /Users/PJS/.rvm/gems/ruby-1.9.2- rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3.rb:2 
c:0022 p:---- s:0064 b:0064 l:000063 d:000063 FINISH 
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC :require 
c:0020 p:0026 s:0058 b:0058 l:000039 d:000057 BLOCK /Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:64 
c:0019 p:---- s:0055 b:0055 l:000054 d:000054 FINISH 
c:0018 p:---- s:0053 b:0053 l:000052 d:000052 CFUNC :each 
c:0017 p:0080 s:0050 b:0050 l:000039 d:000049 BLOCK /Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:62 
c:0016 p:---- s:0045 b:0045 l:000044 d:000044 FINISH 
c:0015 p:---- s:0043 b:0043 l:000042 d:000042 CFUNC :each 
c:0014 p:0046 s:0040 b:0040 l:000039 d:000039 METHOD /Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:51 
c:0013 p:0021 s:0036 b:0036 l:000035 d:000035 METHOD /Users/PJS/.rvm/gems/ruby-1.9.2- rc2/gems/bundler-1.0.0.rc.2/lib/bundler.rb:114 
c:0012 p:0079 s:0032 b:0032 l:000031 d:000031 TOP /Users/PJS/hope_app/config/application.rb:7 
c:0011 p:---- s:0030 b:0030 l:000029 d:000029 FINISH 
c:0010 p:---- s:0028 b:0028 l:000027 d:000027 CFUNC :require 
c:0009 p:0016 s:0024 b:0024 l:000015 d:000023 BLOCK /Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:28 
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH 
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :tap 
c:0006 p:0468 s:0016 b:0016 l:000015 d:000015 TOP /Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:27 
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH 
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require 
c:0003 p:0061 s:0006 b:0006 l:001598 d:0013a8 EVAL script/rails:6 
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH 
c:0001 p:0000 s:0002 b:0002 l:001598 d:001598 TOP 
--------------------------- 
-- Ruby level backtrace information ---------------------------------------- 
script/rails:6:in `<main>' 
script/rails:6:in `require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:27:in `<top (required)>' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:27:in `tap' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:28:in `block in <top (required)>' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/commands.rb:28:in `require' 
/Users/PJS/hope_app/config/application.rb:7:in `<top (required)>' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler.rb:114:in `require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:51:in `require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:51:in `each' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:62:in `block in require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:62:in `each' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:64:in `block (2 levels) in require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/bundler-1.0.0.rc.2/lib/bundler/runtime.rb:64:in `require' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3.rb:2:in `<top (required)>' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3.rb:6:in `rescue in <top (required)>' 
/Users/PJS/.rvm/gems/ruby-1.9.2-rc2/gems/sqlite3-ruby-1.3.1/lib/sqlite3.rb:6:in `require' 

-- C level backtrace information ------------------------------------------- 

回答

1

我有完全一样的版本,你有,我没有看到这一点。但我不在Macbook Pro上。

很难说这是否是Ruby 1.9.2的问题(因为它仍然不够稳定,无法正式发布),还是这实际上是Sqlite 3 gem中的一个bug。完全相同的错误是reported针对稍早版本的Ruby 1.9.2的gem。

您可能会暂时退回到Sqlite 1.3.0或返回到Ruby 1.9.1,直到问题自行解决。几乎没有令人满意的答案,但至少你可以再次生产。

1

我也用同样的问题打在sqlite3的,红宝石1.3.2 后反复卸下安装和卸载的sqlite3一样,红宝石

我终于完全去除RVM DIR

rm -rf /usr/local/lib/rvm /usr/local/bin/{r*,gem-ruby-1.9.2-p136,irb-ruby-1.9.2-p136,testrb-ruby-1.9.2-p136} /usr/local/rvm 

然后重新安装它,

我怀疑

libsqlite3-0 libsqlite3-dev sqlite3 

所有三个必须在rvm安装之前安装, ,因为我在其他机器遵循相同的步骤它工作正常。

是的,这不是正确的解决方案。

+0

类似的问题 - 没有一个sqlite3相关的解决方案帮助。我吹走了我的.rvm目录并重新安装了rvm,那也没用,它一直挂在我的ruby安装上。然后在我第二次重新安装rvm之前,我继续更新rvm本身,然后继续:'rvm get head'就是这样,一切都从那里开始。 – johnmartirano 2012-12-10 05:32:48

+1

不过,不要以为上面的Sharad的命令是准确的,我系统上的rm -rf会吹走各种非rvm的东西。 – johnmartirano 2012-12-10 05:34:04

1

我有一个类似的问题 - 它看起来像Rails试图使用不同版本的Ruby(1.9.2dev而不是1.9.2-rc2)。你可以用

head -1 `which rails` 

变化即第一行证实了这一点,或重新安装宝石与gem uninstall rails && gem install rails

(附注:感谢venj为解决here

1

,当我在我的Gemfile宣布为“测试”组两次我得到这个错误。一旦我摆脱了第二个声明没有更多的分割错误。

39

this post,我已重新安装sqlite3的宝石和问题就消失了:

gem uninstall sqlite3 
gem install sqlite3 

我的软件版本:

% ruby -v 
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin11.2.0] 
% rails -v 
Rails 3.2.1 
1

我在哪里,我仍然得到赛格故障的问题在卸载并重新安装了sqlite3 gem和自制的sqlite3包之后。原来,即使rvm使用红宝石1.9.3,rake仍然指向狮子附带的1.8.7安装。

$rake db:create 
/Users/jessesanford/.rvm/gems/ruby-1.9.3-p125/gems/sqlite3-1.3.6/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault 
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] 

我不知道佣金是怎么安装红宝石宝石库1.9.3与认领脚本头对准了1.8.7,但不管是什么原因重新安装耙纠正它,现在事情正在平稳运行。

2

我和1.9.3有类似的问题。我只好:

  1. 解除停止sqlite3的,并重新安装
  2. 对于额外的措施耙卸载并重新安装它。

现在工作。

5

我发现完全关闭我的外壳(关闭所有窗口,然后右键单击dock中的终端图标并选择关闭),然后重新启动终端来解决此问题。

在我看到这个问题之前,我一直在创建和销毁,使用和更改gemsets一段时间。我怀疑事情只是困惑而已。