Rails 4 服务器失败,Ruby 2.0 分段错误,中止陷阱 6 [英] Rails 4 server fails, Ruby 2.0 segmentation fault, Abort trap 6
问题描述
我刚刚开始浏览 railstutorial.org 并设置我的开发环境.当我进入 1.2.5 节为 fist_app 运行 rails server 时,我输入命令并打印出以下内容:
$ rails 服务器/Users/aaronpflower/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/sqlite3-1.3.8/lib/sqlite3/sqlite3_native.bundle: [BUG] 分割错误 ruby 2.0.0p481 (2014-05-08 修订版 45883) [x86_64-darwin13.2.0]
然后是 500 行文本
<块引用>0 enumerator.so1/用户/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/encdb.bundle2/Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/trans/transdb.bundle3/用户/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/rbconfig.rb4/用户/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb5/Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb6/Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb7/Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb8/用户/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/version.rb9/用户/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
结尾是:
<块引用>[注意]您可能在 Ruby 解释器或扩展库中遇到了错误.欢迎报告错误.详情:http://www.ruby-lang.org/bugreport.html中止陷阱:6
当这第一次发生时,请仔细检查教程中导致此问题的步骤,因为作为初学者的可能性很高.我输入了以下命令和一切结帐.(我也在使用 OS 10.9.3)
$ rails -v导轨 4.0.5$ 红宝石 -v2.0.0p481$ rvm -v1.25.27$ 酿造医生系统准备好酿造
通过搜索一些帖子建议卸载 sqlite3 然后重新安装,但我仍然收到相同的 seg 错误消息.不确定下一步.
您的 Rails -v 和 Ruby -v 适合本教程.
我还可以从输入中看到您的 gemfile
中包含 gem 'sqlite3', '1.3.8'
.
1:你捆绑了吗?
您上次运行 bundle update
或 bundle install
是什么时候?
你是如何卸载 sqlite3 的?你使用了 $ gem uninstall sqlite3
吗?尝试卸载然后重新安装 gem.
2:- 什么版本管理器?
您是否使用 rvm、rbenv 或 homebrew 进行安装?为不同的部分使用不同的版本管理器可能会产生沟通问题.
3:你安装了 Xcode 吗?
这取自 http://www.railstutorial.org:
<小时>作为先决条件,OS X 用户可能需要安装 Xcode 开发人员工具.为了避免(巨大的)完全安装,我建议使用更小的 Xcode 命令行工具.
<小时>要安装 Xcode(我的建议),请在 AppStore 中查找.
安装命令行工具(MHartl 推荐) - https://developer.apple.com/downloads/
4:你在使用`bundle exec`吗?
试试 bundle exec rails c
和 bundle exec rails s
5:尝试刷新"你的包目录
如果 bundle exec
不起作用删除 .bundle/目录并使用
rm -rf .bundle/&&捆
I just started going through railstutorial.org and getting my development environment setup. When I got to the section 1.2.5 to run rails server for the fist_app, I type the command and the following printed out:
$ rails server
/Users/aaronpflower/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/sqlite3- < 1.3.8/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-darwin13.2.0]
Then followed by 500 lines of text
0 enumerator.so 1 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/encdb.bundle 2 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/enc/trans/transdb.bundle 3 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/x86_64-darwin13.2.0/rbconfig.rb 4 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb 5 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb 6 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb 7 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb 8 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/version.rb 9 /Users/aaronpflower/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
Which ended with:
[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: 6
When this first happened double checked the steps leading up to this in the tutorial, since being a beginner that was a high possibility. I typed the follow commands and everything checkout. (I'm also using OS 10.9.3)
$ rails -v
Rails 4.0.5
$ ruby -v
2.0.0p481
$ rvm -v
1.25.27
$ brew doctor
system ready to brew
Through searching some posts have suggested to uninstall sqlite3 and then re-install but I still got the same seg fault message. Not sure of the next step.
Your Rails -v and Ruby -v are correct for this tutorial.
I can also see from the input that your gemfile
has gem 'sqlite3', '1.3.8'
in it.
1: Have you bundled?
When was the last time you ran bundle update
or bundle install
?
How did you go about uninstalling sqlite3? Did you use $ gem uninstall sqlite3
?
Try uninstalling and then reinstalling the gem.
2: - What version manager?
Did you use rvm, rbenv or homebrew to install? Using different version managers for different pieces can create communication issues.
3: Did you install Xcode?
This is taken from http://www.railstutorial.org:
"As a prerequisite, OS X users may need to install the Xcode developer tools. To avoid the (huge) full installation, I recommend the much smaller Command Line Tools for Xcode.
To install Xcode (my recommendation), look it up in the AppStore.
To install Command Line Tools (MHartl's recommendation) - https://developer.apple.com/downloads/
4: Are you using `bundle exec`?
Try bundle exec rails c
and bundle exec rails s
5: Try 'refreshing' your bundle directory
If bundle exec
doesn't work
Remove the .bundle/ directory and re-bundle with
rm -rf .bundle/ && bundle
这篇关于Rails 4 服务器失败,Ruby 2.0 分段错误,中止陷阱 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!