Rails控制台的问题

时间:2012-03-22 03:28:53

标签: ruby-on-rails-3 gcc console

我在使用rails c。

尝试使用rails(3.2.1)控制台时遇到问题

它在各种命令中随机出现,但最明显的是当我退出控制台时,它就是它显示的内容:

1.9.3p125 :001 > exit
/Users/mikey/.rvm/scripts/irbrc.rb:32: [BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0014 b:0014 l:000013 d:000013 CFUNC  :initialize
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC  :open
c:0003 p:0140 s:0007 b:0007 l:000c70 d:000006 BLOCK  /Users/mikey/.rvm/scripts/irbrc.rb:32
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001ee8 d:001ee8 TOP   

-- Ruby level backtrace information ----------------------------------------
/Users/mikey/.rvm/scripts/irbrc.rb:32:in `block in <top (required)>'
/Users/mikey/.rvm/scripts/irbrc.rb:32:in `open'
/Users/mikey/.rvm/scripts/irbrc.rb:32:in `initialize'

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

   See Crash Report log file under ~/Library/Logs/CrashReporter or
   /Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

* Loaded script: script/rails

* Loaded features:

    0 enumerator.so
    1 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/enc/encdb.bundle
    2 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/enc/trans/transdb.bundle
    3 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb
    4 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/rbconfig.rb
    5 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb
    6 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb
    7 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
    8 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb
    9 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/pathname.bundle
   10 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/pathname.rb
   11 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/version.rb
   12 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/etc.bundle
   13 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb
   14 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb
   15 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb
   16 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb
   17 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb
   18 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/path_support.rb
   19 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/psych.bundle
   20 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/stringio.bundle
   21 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/node.rb
   22 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/stream.rb
   23 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/document.rb
   24 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/sequence.rb
   25 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/scalar.rb
   26 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/mapping.rb
   27 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes/alias.rb
   28 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/nodes.rb
   29 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/streaming.rb
   30 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/visitor.rb
   31 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/strscan.bundle
   32 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/scalar_scanner.rb
   33 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/to_ruby.rb
   34 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/emitter.rb
   35 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb
   36 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/json/ruby_events.rb
   37 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/json_tree.rb
   38 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors/depth_first.rb
   39 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/visitors.rb
   40 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/handler.rb
   41 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/tree_builder.rb
   42 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/parser.rb
   43 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/omap.rb
   44 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/set.rb
   45 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/coder.rb
   46 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/core_ext.rb
   47 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/date_core.bundle
   48 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/date/format.rb
   49 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/date.rb
   50 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/deprecated.rb
   51 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych/json.rb
   52 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/psych.rb
   53 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/psych_tree.rb
   54 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/yaml.rb
   55 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/syck_hack.rb
   56 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/rubygems_integration.rb
   57 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/shared_helpers.rb
   58 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/fileutils.rb
   59 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/psyched_yaml.rb
   60 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/gem_helpers.rb
   61 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/match_platform.rb
   62 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/rubygems_ext.rb
   63 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/version.rb
   64 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler.rb
   65 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest.bundle
   66 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/digest.rb
   67 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest/sha1.bundle
   68 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/environment.rb
   69 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/runtime.rb
   70 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/settings.rb
   71 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/set.rb
   72 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/definition.rb
   73 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/dependency.rb
   74 /Users/mikey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.2/lib/bundler/dsl.rb
   75 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/common.rb
   76 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/generic.rb
   77 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/ftp.rb
   78 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/http.rb
   79 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/https.rb
   80 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/ldap.rb
   81 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/ldaps.rb
   82 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri/mailto.rb
   83 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/uri.rb
   84 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/user_interaction.rb
   85 /Users/mikey/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/package/f_sync_dir.rb
..... and so on ...

值得一提的是,我之前使用rvm安装1.9.3时遇到了问题,这与“传统”gcc4.2有关,但是我在stackoverflow中使用了一个人来解决这个问题:下载了osx-gcc包并使用: CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared --with-readline-dir=$rvm_path/usr

但后来我遇到了上述问题。

这完全令人沮丧......不确定是做什么的。谢谢。

1 个答案:

答案 0 :(得分:1)

好吧,经过几个小时拉我的头发,我能够通过以下方式解决它:

rvm uninstall 1.9.3 (not sure this step in mendatory)
rvm remove 1.9.3
rvm pkg install iconv
rvm pkg install openssl
CC=/usr/bin/gcc rvm install ruby-1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr

部分取自: Persistent Ruby segfaulting after a clean install