Issues with Nokogiri on Mac - nokogiri

I am trying to parse an OFX file from the ofx gem, which works fine in Ubuntu but
gives me an error on Mac OS.
I am using RVM. Here are the details:
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553)
rails -v
2.3.11
gem -v
1.6.2
* gem list *
nokogiri (1.5.0, 1.4.6)
ofx (0.3.1)
-- control frame ----------
c:0065 p:---- s:0320 b:0320 l:000319 d:000319 CFUNC :root
c:0064 p:0052 s:0317 b:0317 l:000316 d:000316 METHOD /Users/abc/.rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/node.rb:100
c:0063 p:0030 s:0311 b:0309 l:000308 d:000308 METHOD /Users/abc/.rvm/gems/ruby-1.9.2-p290/gems/ofx-0.3.1/lib/ofx/parser/ofx102.rb:50
c:0062 p:0025 s:0306 b:0306 l:000305 d:000305 METHOD /Users/abc/.rvm/gems/ruby-1.9.2-p290/gems/ofx-0.3.1/lib/ofx/parser/ofx102.rb:26
c:0061 p:0302 s:0303 b:0303 l:000302 d:000302 METHOD /Users/abc/Code/RubyUpgrade/app/models/check_clear.rb:38
c:0060 p:---- s:0297 b:0297 l:000296 d:000296 FINISH
c:0059 p:---- s:0295 b:0295 l:000294 d:000294 CFUNC :new
c:0058 p:0050 s:0289 b:0289 l:001898 d:000288 BLOCK /Users/abc/Code/RubyUpgrade/app/controllers/checks_controller.rb:116
c:0057 p:0182 s:0287 b:0287 l:000286 d:000286 METHOD /Users/abc/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/database_state

Fix for me was to remove the RVM libiconv package as per instructions here:
https://rvm.io/packages/iconv/

Related

BUG Segmentation fault at 0x0000000000000000 in mysql2 in ruby on rails

I am using
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux] )
Rails 5.0.7.2
while execute the rails c command it throws below error -
`
`home/user/.rvm/gems/ruby-2.5.8/gems/mysql2-0.5.3/lib/mysql2/client.rb:90: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0044 p:---- s:0331 e:000330 CFUNC :connect
c:0043 p:0614 s:0319 e:000318 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/mysql2-0.5.3/lib/mysql2/client.rb:90 [FINISH]
c:0042 p:---- s:0305 e:000304 CFUNC :new
c:0041 p:0142 s:0300 e:000299 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/mysql2_adapter.rb:25
c:0040 p:0024 s:0293 e:000292 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729
c:0039 p:0021 s:0289 e:000288 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773
c:0038 p:0016 s:0285 e:000284 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752
c:0037 p:0014 s:0279 e:000278 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713
c:0036 p:0012 s:0273 e:000271 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490
c:0035 p:0031 s:0267 e:000263 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364
c:0034 p:0046 s:0260 e:000259 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883
c:0033 p:0011 s:0253 e:000252 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:128
c:0032 p:0004 s:0249 e:000248 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:91
c:0031 p:0012 s:0245 e:000244 METHOD /home/user/.rvm/gems/ruby-2.5.8/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:559`
`[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
Aborted (core dumped)
`
can you give any idea to solve this issue?

Webrick crashing with Segmentation Fault on first page load

I am trying to run a Ruby on Rails application on my development environment (Ubuntu 14.04). rails s does not report errors and Webrick seems to start properly:
$ rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2015-04-30 08:52:32] INFO WEBrick 1.3.1
[2015-04-30 08:52:32] INFO ruby 1.9.3 (2014-11-13) [x86_64-linux]
[2015-04-30 08:52:32] INFO WEBrick::HTTPServer#start: pid=15523 port=3000
However, once I try to access the application through a web browser Webrick crashes with the following error:
/home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:98: [BUG] Segmentation fault
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0016 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :select
c:0015 p:0106 s:0053 b:0053 l:000043 d:000052 BLOCK /home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:98
c:0014 p:0007 s:0047 b:0047 l:000046 d:000046 METHOD /home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:22
c:0013 p:0063 s:0044 b:0044 l:000043 d:000043 METHOD /home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:89
c:0012 p:0118 s:0039 b:0039 l:000038 d:000038 METHOD /home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13
c:0011 p:0294 s:0034 b:0034 l:002200 d:002200 METHOD /home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/server.rb:268
c:0010 p:0231 s:0028 b:0028 l:0011a0 d:0011a0 METHOD /home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands/server.rb:70
c:0009 p:0063 s:0024 b:0024 l:000015 d:000023 BLOCK /home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands.rb:55
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:0702 s:0016 b:0016 l:000015 d:000015 TOP /home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands.rb:50
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:0016e8 d:001838 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:0016e8 d:0016e8 TOP
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `<main>'
script/rails:6:in `require'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
/home/desousa/.rvm/gems/ruby-1.9.3-p551/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run'
/home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:89:in `start'
/home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:22:in `start'
/home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:98:in `block in start'
/home/desousa/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/webrick/server.rb:98:in `select'
-- C level backtrace information -------------------------------------------
SEGV received in SEGV handler
Aborted (core dumped)
The software versions I am using in this project:
$ ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
$ rails -v
Rails 3.2.13
What could be the cause of this? Or can I do to understand the cause?
I had some touble with Webrick too that caused a segementation fault. I only had this on one specific ubuntu box but I didn't have the same error on other ubuntu boxes with the exact same setup. Lately I solved it using thin. To do this add this to your Gemfile:
gem 'thin'
Then run
bundle install
rails server

Rubymine debug [BUG] Segmentation fault

Desc
I got [BUG] Segmentation fault
when i use rubymine5.4 to debug thor method :template
context
rubymine5.4
ruby-debug-ide-0.4.18
ruby 2.0.0
thor 0.18-1
code
#/home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb
def template(source, *args, &block)
#i make a breakpoint in below line
config = args.last.is_a?(Hash) ? args.pop : {}
destination = args.first || source.sub(/\.tt$/, '')
source = File.expand_path(find_in_source_paths(source.to_s))
context = instance_eval('binding')
create_file destination, nil, config do
content = ERB.new(::File.binread(source), nil, '-', '#output_buffer').result(context)
content = block.call(content) if block
content
end
end
got this error:
Fast Debugger (ruby-debug-ide 0.4.17, debase 0.0.7) listens on 127.0.0.1:36963
/home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/ide_processor.rb:27: [BUG] Segmentation fault
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0027 p:---- s:0131 e:000130 CFUNC :frame_binding
c:0026 p:0038 s:0127 e:000125 BLOCK /home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/ide_processor.rb:27
c:0025 p:0026 s:0123 e:000122 METHOD /home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/ide_processor.rb:116 [FINISH]
c:0024 p:---- s:0120 e:000119 CFUNC :new
c:0023 p:0105 s:0117 e:000116 METHOD /home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/ide_processor.rb:23
c:0022 p:0172 s:0108 e:000107 METHOD /home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/event_processor.rb:58
c:0021 p:0043 s:0101 e:000100 METHOD /home/zxr/.rvm/gems/ruby-2.0.0-p247#global/gems/ruby-debug-ide-0.4.17/lib/ruby-debug-ide/event_processor.rb:34
Try updating the debug gem:
gem install ruby-debug-base19x --pre

Ruby 3.2.3 rake does not seem to work - or something. Rake aborted! cannot load such file

So I'm trying to learn Ruby and rails from Lynda.com When I get to the database sections the teacher has us do this schema dump with rake but it aborts and I cant figure out whats wrong (I'm very new to all this so please forgive me =))
OS: Lion
Ruby: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
Rails: Rails 3.2.3
Rake: rake (0.9.2.2)
$PATH: /usr/local/Cellar:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
All the gems should be up to date ( just reinstalled the other day ). If you need to know anything else to help troubleshoot please let me know!
This is the errors I'm getting:
Alex$ rake db:schema:dump
rake aborted!
cannot load such file -- bundler/setup
(See full trace by running task with --trace)
Alex$ rake --trace
rake aborted!
cannot load such file -- bundler/setup
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/Alex/Sites/simple_cms/config/boot.rb:6:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/Alex/Sites/simple_cms/config/application.rb:1:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/Users/Alex/Sites/simple_cms/Rakefile:5:in `<top (required)>'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/rake_module.rb:25:in `load'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:501:in `raw_load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:82:in `block in load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:81:in `load_rakefile'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:65:in `block in run'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/local/bin/rake:32:in `<main>'
Got this when I tried to reinstall budel and run this command:
Alex$ bundle exec rake db:schema:dump
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
-- Control frame information -----------------------------------------------
c:0030 p:-17562901266652 s:0090 b:0090 l:000089 d:000089 TOP
c:0029 p:---- s:0088 b:0088 l:000087 d:000087 CFUNC :require
c:0028 p:0119 s:0084 b:0084 l:000083 d:000083 TOP /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9
c:0027 p:---- s:0082 b:0082 l:000081 d:000081 FINISH
c:0026 p:---- s:0080 b:0080 l:000079 d:000079 CFUNC :require
c:0025 p:0026 s:0076 b:0076 l:000056 d:000075 BLOCK /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68
c:0024 p:---- s:0073 b:0073 l:000072 d:000072 FINISH
c:0023 p:---- s:0071 b:0071 l:000070 d:000070 CFUNC :each
c:0022 p:0091 s:0068 b:0068 l:000056 d:000067 BLOCK /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 FINISH
c:0020 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :each
c:0019 p:0046 s:0057 b:0057 l:000056 d:000056 METHOD /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55
c:0018 p:0021 s:0053 b:0053 l:000052 d:000052 METHOD /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119
c:0017 p:0089 s:0049 b:0049 l:000048 d:000048 TOP /Users/Alex/Sites/simple_cms/config/application.rb:7
c:0016 p:---- s:0047 b:0047 l:000046 d:000046 FINISH
c:0015 p:---- s:0045 b:0045 l:000044 d:000044 CFUNC :require
c:0014 p:0026 s:0041 b:0041 l:000040 d:000040 TOP /Users/Alex/Sites/simple_cms/Rakefile:5
c:0013 p:---- s:0039 b:0039 l:000038 d:000038 FINISH
c:0012 p:---- s:0037 b:0037 l:000036 d:000036 CFUNC :load
c:0011 p:0013 s:0033 b:0033 l:000032 d:000032 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25
c:0010 p:0274 s:0029 b:0029 l:000028 d:000028 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:501
c:0009 p:0009 s:0024 b:0024 l:000017 d:000023 BLOCK /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:82
c:0008 p:0009 s:0022 b:0022 l:000021 d:000021 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133
c:0007 p:0011 s:0018 b:0018 l:000017 d:000017 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:81
c:0006 p:0019 s:0015 b:0015 l:000008 d:000014 BLOCK /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:65
c:0005 p:0009 s:0013 b:0013 l:000012 d:000012 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133
c:0004 p:0011 s:0009 b:0009 l:000008 d:000008 METHOD /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63
c:0003 p:0048 s:0006 b:0006 l:0003a8 d:000a48 EVAL /usr/local/bin/rake:32
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0003a8 d:0003a8 TOP
......
[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
Alex$
The error is to long to fit into this field.
Install rvm
Create a new gemset for ur project. Im betting youre using aystem ruby that comes with Lion in some regards
I've resolved this by running:
gem install bundler
If you try that and it shows you have bundler installed, try typing:
bundle exec rake db:schema:dump
You may be running the command outside the scope of the current bundle.
Here's a bit more background information on why you need to add bundle exec in front of your rake commands:
http://gembundler.com/
Also, note that rake isn't required in your 'Gemfile' as long as you have rails specified. rake installs as a dependency of rails. To see the correlation, take a look at your Gemfile.lock.
Once you install rvm, add the following to a file named .rvmrc in the root directory of your project:
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.3-p125#MYPROJECTNAME" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/ruby-1.9.3-p125#MYPROJECTNAME"
else
rvm --create use "ruby-1.9.3-p125#MYPROJECTNAME"
fi
Substitute your project name for "MYPROJECTNAME" and the appropriate ruby version where you see ruby-1.9.3-p125. Then when you change into that directory, rvm will automatically set the gemset and ruby version for you.
The problem seems to be that I installed bundle after I installed ruby & rails. I uninstalled ruby and all my gems (but left bundle and homebrew) and then used rvm to install the latest ruby and rails.
Also note I did not use sudo unless it required me to. I think this put the files in a different place and that might have also helped.
rake commands are now working (with out using the bundle command before it).
So basically I had bundle installed and then did everything this guy did at the bottom of his questions ( #5 gave me and error and did not install ).
How do you install (build) Ruby 1.9.3 on OSX Lion?
Hope this helps anyone else running into the same problem I did.

How to solve the "[BUG] Segmentation fault"?

I am using a Mac OS running Snow Leopard 10.6.8 and RVM 1.10.3, Ruby 1.9.3-p125, Ruby on Rails 3.2.2 and rspec-rails-2.8.1. I have properly installed and configured all gems, but when in the Terminal window I run the rake spec command I get the following:
$ rake spec
/<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10: [BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]
-- Control frame information -----------------------------------------------
c:0045 p:0011 s:0136 b:0136 l:000135 d:000135 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10
c:0044 p:0011 s:0134 b:0134 l:000133 d:000133 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:4
c:0043 p:0021 s:0132 b:0132 l:000131 d:000131 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby-
1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:3
c:0033 p:0220 s:0104 b:0104 l:0020f0 d:0020f0 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard.rb:57
c:0032 p:---- s:0101 b:0101 l:000100 d:000100 FINISH
c:0031 p:---- s:0099 b:0099 l:000098 d:000098 CFUNC :require
c:0030 p:0026 s:0095 b:0095 l:000380 d:000470 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:68
c:0029 p:---- s:0092 b:0092 l:000091 d:000091 FINISH
c:0028 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC :each
c:0027 p:0091 s:0087 b:0087 l:000380 d:000408 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:66
c:0026 p:---- s:0081 b:0081 l:000080 d:000080 FINISH
c:0025 p:---- s:0079 b:0079 l:000078 d:000078 CFUNC :each
c:0024 p:0046 s:0076 b:0076 l:000380 d:000380 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:55
c:0023 p:0021 s:0072 b:0072 l:0004e0 d:0004e0 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler.rb:118
c:0022 p:0089 s:0068 b:0068 l:000548 d:000548 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/application.rb:7
c:0021 p:---- s:0066 b:0066 l:000065 d:000065 FINISH
c:0020 p:---- s:0064 b:0064 l:000063 d:000063 CFUNC :require
c:0019 p:0026 s:0060 b:0060 l:0005a8 d:0005a8 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/environment.rb:2
c:0018 p:---- s:0058 b:0058 l:000057 d:000057 FINISH
c:0017 p:---- s:0056 b:0056 l:000055 d:000055 CFUNC :require
c:0016 p:0058 s:0052 b:0052 l:000608 d:000608 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/spec_helper.rb:3
c:0015 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0014 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :require
c:0013 p:0011 s:0044 b:0044 l:000668 d:000668 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/controllers/users_controller_spec.rb:1
c:0012 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0011 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :load
c:0010 p:0025 s:0036 b:0036 l:0006c8 d:000730 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698
c:0009 p:---- s:0033 b:0033 l:000032 d:000032 FINISH
c:0008 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC :map
c:0007 p:0023 s:0028 b:0028 l:0006c8 d:0006c8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698
c:0006 p:0074 s:0025 b:0025 l:0007a8 d:0007a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22
c:0005 p:0055 s:0020 b:0020 l:000820 d:000820 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80
c:0004 p:0101 s:0014 b:0014 l:0008a8 d:0008a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69
c:0003 p:0021 s:0007 b:0006 l:001788 d:000908 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002388 d:002388 TOP
-- 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: /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/bin/rspec
* Loaded features:
0 enumerator.so
1 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
2 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
3 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb
...
[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
rake aborted!
/<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/controllers/users_controller_spec.rb ... failed
How can I solve the issue?
Note: I noted that the problem happens sometimes, randomly!
In my Gemfile I have:
...
group :development, :test do
gem "rspec-rails"
gem 'webrat'
end
group :test do
gem 'factory_girl_rails'
gem 'cucumber-rails'
gem 'turn', :require => false
end
...
EDITED: Based on the information you have provided so far, it seems like you have found a bug in Ruby 1.9.3. I recommend that you report this to the Ruby core team.
Until this bug is fixed, you must find a way around it. To find a way around it, you must get more details about exactly what does and does not trigger it.
In the stack trace which you posted, it looks like line 68 of bundler/runtime.rb is requiring the yard gem. Using Ruby 1.9.3, try requiring the yard gem yourself, from IRB or a simple test script. Does that trigger the error? If not, go to the method which "realer" is calling in "bundler" (bundler.rb, line 118). Try calling that method (whatever it is) yourself, from a test script. Does that trigger the error? ...and so on.
Fortunately, when you install Ruby gems, the source code is available in the "gems" directory, and you can study and modify it. I have also had to "hack" the source code of my gems before to work around problems (until a fixed version of the gem is released).
I have the same issue, random crashes related supposedly to Yard when running rspec.
I found another post that fixed the issue for me. Removed 'pry-doc' dependency.
StackOverflow Post

Resources