Ruby (or FFI?) error when executing Jekyll commands - ruby

I want to create a new Webpage using Jekyll, but when I execute jekyll new <page>, Ruby crashes with a really long Crash Report that starts like this:
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x0000000100e08000
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0027 p:---- s:0156 e:000155 CFUNC :attach
c:0026 p:0258 s:0150 e:000149 METHOD /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275
c:0025 p:0023 s:0130 e:000129 METHOD /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:40
c:0024 p:0012 s:0125 e:000124 CLASS /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:5
c:0023 p:0007 s:0122 e:000121 CLASS /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:4
c:0022 p:0007 s:0119 e:000118 TOP /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:3 [FINISH]
c:0021 p:---- s:0116 e:000115 CFUNC :require_relative
c:0020 p:0247 s:0111 e:000110 CLASS /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60
c:0019 p:0007 s:0107 e:000106 CLASS /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:6
c:0018 p:0014 s:0104 e:000103 TOP /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:5 [FINISH]
c:0017 p:---- s:0101 e:000100 CFUNC :require_relative
c:0016 p:0021 s:0096 e:000095 TOP /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31 [FINISH]
c:0015 p:---- s:0093 e:000092 CFUNC :require
c:0014 p:0110 s:0088 e:000087 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0013 p:0006 s:0076 e:000075 TOP /Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll/converters/scss.rb:3 [FINISH]
c:0012 p:---- s:0073 e:000072 CFUNC :require
c:0011 p:0110 s:0068 e:000067 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0010 p:0013 s:0056 e:000055 TOP /Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll-sass-converter.rb:4 [FINISH]
c:0009 p:---- s:0053 e:000052 CFUNC :require
c:0008 p:0110 s:0048 e:000047 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0007 p:0226 s:0036 e:000035 TOP /Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/lib/jekyll.rb:195 [FINISH]
c:0006 p:---- s:0033 e:000032 CFUNC :require
c:0005 p:0110 s:0028 e:000027 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0004 p:0041 s:0016 e:000015 TOP /Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/exe/jekyll:8 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC :load
c:0002 p:0109 s:0008 E:001cc0 EVAL /usr/local/bin/jekyll:23 [FINISH]
c:0001 p:0000 s:0003 E:000cc0 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/jekyll:23:in `<main>'
/usr/local/bin/jekyll:23:in `load'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/exe/jekyll:8:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/lib/jekyll.rb:195:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:5:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:6:in `<module:SassC>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60:in `<module:Native>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60:in `require_relative'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:3:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:4:in `<module:SassC>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:5:in `<module:Native>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:40:in `attach_function'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach_function'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach'
I am using a MacBook Pro with M1 Pro. Ruby has been installed via Homebrew and always worked fine on my Intel-MacBook. Does somebody know this error?
Regards,
Yannick

The issue was the following: I installed Ruby with Homebrew, but macOS ships its own Ruby, but in the wrong version. I followed this tutorial and that solved my problem.

I think it's an issue specific to M1 MacBooks, You can try
arch -arch x86_64 bundle install
arch -arch x86_64 bundle exec jekyll serve
Although I believe it's not an "ideal fix". Solution suggested by #Yannick seems promising, but I haven't tried it.

Related

Monkey patching Object leads to Pry deadlock

I'm trying to monkey patch Object and while my tests run fine,
I can't load my project with Pry anymore.
Here is the relevant code:
module CoreExtensions
def instance_values
instance_variables.each_with_object({}) do |var, hash|
hash[var[1..-1]] = instance_variable_get(var)
end
end
def ==(other)
(self.class == other.class) &&
(instance_values.equal? other.instance_values)
end
end
Object.include CoreExtensions
Using
pry -r ./core_extentions.rb
leads to this stacktrace:
Error: No live threads left. Deadlock?
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `sleep'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `wait'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `block in enter_interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:83:in `synchronize'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:83:in `enter_interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:110:in `interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:197:in `input_readline'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:190:in `block in read_line'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:219:in `block in <top (required)>'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `block in parse_options'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `each'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `parse_options'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/bin/pry:16:in `<top (required)>' /home/fap/.rvm/gems/ruby-2.3.0/bin/pry:23:in `load'
/home/fap/.rvm/gems/ruby-2.3.0/bin/pry:23:in main
/home/fap/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/fap/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in main
The same thing happens when I include my CoreExtentions in the main class.
I read about Pry's input_lock, but I don't understand what produces the deadlock.
Does anyone have an idea why this is happening?
You have redefined method == for all objects, which is not a good thing.
This comes about from the last line in your question, namely Object.include CoreExtentions
Without that definition, it loads fine.

Upgrading to Rails4 and I cant pass this devise test that passed in Rails3

undefined local variable or method `login_user'
Why are my controllers not getting the extended ControllerMacros ???
Commit in question: https://github.com/shadowbq/cartoque/commit/2fba99c6eac5f9f2f0da2dd464f475cae0bae520
<snip>
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
<...snip>
<snip>
# include devise helpers in controller specs
config.include Devise::TestHelpers, :type => :controller
config.extend ControllerMacros, :type => :controller
<...snip>
/usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:675:in `method_missing': undefined local variable or method `login_user' for RSpec::ExampleGroups::BackupExclusionsController:Class (NameError)
from /home/shadowbq/sandbox/cartoque/spec/controllers/backup_exlusions_controller_spec.rb:5:in `block in <top (required)>'
<snip>
module ControllerMacros
def login_admin
before(:each) do
#request.env["devise.mapping"] = Devise.mappings[:admin]
#user = FactoryGirl.create(:admin)
sign_in #user
end
end
def login_user
before(:each) do
#request.env["devise.mapping"] = Devise.mappings[:user]
#user = FactoryGirl.create(:user)
sign_in #user
end
end
end
<...snip>
Here is full backtrace as well..
/usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:675:in `method_missing': undefined local variable or method `login_user' for RSpec::ExampleGroups::BackupExclusionsController:Class (NameError)
from /home/shadowbq/sandbox/cartoque/spec/controllers/backup_exlusions_controller_spec.rb:5:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `module_exec'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `subclass'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:255:in `block in define_example_group_method'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/dsl.rb:43:in `block in expose_example_group_alias'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/dsl.rb:82:in `block (2 levels) in expose_example_group_alias_globally'
from /home/shadowbq/sandbox/cartoque/spec/controllers/backup_exlusions_controller_spec.rb:3:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in `load'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in `each'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:102:in `setup'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:in `run'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in `run'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in `invoke'
from /usr/local/rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec:4:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.3/bin/rspec:23:in `load'
from /usr/local/rvm/gems/ruby-2.2.3/bin/rspec:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
More file snippets
root#ubuntu:/home/shadowbq/sandbox/cartoque# head -15 spec/controllers/backup_exlusions_controller_spec.rb
require 'spec_helper'
describe BackupExclusionsController do
login_user
before do
#backup_exclusion = BackupExclusion.create
end
it "gets index" do
get :index
assert_response :success
assert_not_nil assigns(:backup_exclusions)
end
https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-%28and-RSpec%29
In rspec-rails 3, specs no longer have their type set automatically based on path, so your controller specs no longer have type :controller. You can either:
reneebable this with the config.infer_spec_type_from_file_location! option
explicitly tag your controller specs with type: :controller

Ruby: Rspec 2.14.1 on ruby 1.9.1 compatibility

Before anything, I know 1.9.1 (1.9.1-p243 specifically) is old and broken, but we have an app with a pretty strict dependency on it.
First off, is there a list of rspec-supported rubies?
Secondly, when putting anything in a describe block in a spec, I get an error uninitialized constant BasicObject::Class (NameError).
With this spec:
require_relative 'rspec_basic_object_test'
describe RspecBasicObjectTest do
before :each do
#obj = RspecBasicObjectTest.new
end
it 'returns something' do
#obj.foo.should == "foo"
end
end
and this ruby file:
class RspecBasicObjectTest
attr_reader :foo
def initialize
#foo = "foo"
end
end
I get:
dlampa#ubuntu:~/code/mine$ rspec rspec_basic_object_test_spec.rb
/home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:74:in `block in enable_should': uninitialized constant BasicObject::Class (NameError)
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:28:in `class_eval'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:28:in `enable_should'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:34:in `syntax='
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:52:in `<module:Mocks>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:2:in `<module:RSpec>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/framework.rb:34:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/mocking/with_rspec.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:388:in `mock_with'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:278:in `mock_framework'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:884:in `configure_mock_framework'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:280:in `ensure_example_groups_are_configured'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:295:in `set_it_up'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:245:in `subclass'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:232:in `describe'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/dsl.rb:18:in `describe'
from /home/dlampa/code/mine/rspec_basic_object_test_spec.rb:3:in `<top (required)>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `each'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:22:in `run'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `block in autorun'
Anyone else run into this? Or am I just missing something obvious in rspec's README that says 1.9.1 is old and broken, why are you using it?

EM.synchrony block causing segfault

Not entirely sure what's going on here, but I can't seem to call the EM.synchrony block without it crashing.
I'm using EM-Synchrony version 1.0.0 with EM-Http-Request version 1.0.0, and EventMachine version 1.0.0.beta.4. I'm attempting to run it on a Mac (Lion) using RVM and Ruby 1.9.2p290. Here's the backtrace from the segfault:
ruby-1.9.2-p290 :003 > EM.synchrony {}
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/em-synchrony-1.0.0/lib/em- synchrony.rb:25: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0035 p:---- s:0127 b:0127 l:000126 d:000126 CFUNC :resume
c:0034 p:0021 s:0124 b:0124 l:001fb8 d:002418 BLOCK /Users/ryan/.rvm/gems/ruby-1.9.2- p290#myapp/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25
c:0033 p:---- s:0122 b:0122 l:000121 d:000121 FINISH
c:0032 p:---- s:0120 b:0120 l:000119 d:000119 CFUNC :call
c:0031 p:---- s:0118 b:0118 l:000117 d:000117 CFUNC :run_machine
c:0030 p:0248 s:0115 b:0115 l:000114 d:000114 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2- p290#myapp/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179
c:0029 p:0056 s:0108 b:0108 l:001fb8 d:001fb8 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:27
c:0028 p:0015 s:0101 b:0101 l:001d98 d:0007d8 EVAL (irb):3
c:0027 p:---- s:0099 b:0099 l:000098 d:000098 FINISH
c:0026 p:---- s:0097 b:0097 l:000096 d:000096 CFUNC :eval
c:0025 p:0028 s:0090 b:0090 l:000089 d:000089 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80
c:0024 p:0033 s:0083 b:0082 l:000081 d:000081 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/context.rb:254
c:0023 p:0031 s:0077 b:0077 l:0005d8 d:000076 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:159
c:0022 p:0042 s:0069 b:0069 l:000068 d:000068 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:273
c:0021 p:0011 s:0064 b:0064 l:0005d8 d:000063 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:156
c:0020 p:0144 s:0060 b:0060 l:000043 d:000059 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:243
c:0019 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0018 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC :loop
c:0017 p:0009 s:0052 b:0052 l:000043 d:000051 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229
c:0016 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0015 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :catch
c:0014 p:0023 s:0044 b:0044 l:000043 d:000043 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228
c:0013 p:0046 s:0041 b:0041 l:0005d8 d:0005d8 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:155
c:0012 p:0011 s:0038 b:0038 l:0005b8 d:000037 BLOCK /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:70
c:0011 p:---- s:0036 b:0036 l:000035 d:000035 FINISH
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 CFUNC :catch
c:0009 p:0183 s:0030 b:0030 l:0005b8 d:0005b8 METHOD /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69
c:0008 p:0222 s:0025 b:0025 l:001d70 d:001d70 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands/console.rb:45
c:0007 p:0019 s:0021 b:0021 l:000020 d:000020 METHOD /Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands/console.rb:8
c:0006 p:0615 s:0017 b:0017 l:000016 d:000016 TOP /Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands.rb:40
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:000b38 d:000308 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:000b38 d:000b38 TOP
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `<main>'
script/rails:6:in `require'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `catch'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:70:in `block in start'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/context.rb:254:in `evaluate'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
/Users/ryan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80:in `eval'
(irb):3:in `irb_binding'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:27:in `synchrony'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `call'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25:in `block in synchrony'
/Users/ryan/.rvm/gems/ruby-1.9.2-p290#myapp/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:25:in `resume'
-- C level backtrace information -------------------------------------------
Any ideas?
Filed an issue on the EM-Synchrony GH repo. Igrigorik responded that it's a known bug with 1.9.2. Upgrading to 1.9.3 fixed this for me.

Why am I getting a segmentation fault in libxml_ruby.bundle when using the pivotal-tracker gem?

I have a Ruby 1.9.2-p290 program which is using the pivotal-tracker gem. The configuration of the application environment is using RVM. When I execute this on one machine the application works as expected yet on a different machine it results in the error below.
To simplify the problem I made a new ruby file with only the following contents and still receive the error:
require 'pivotal-tracker'
puts 'hello'
Given this works on one machine and not another I assume there is a configuration difference of some sort between the two.
What is the best way to debug what is going on to cause this error?
Thank you in advance!
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle:
> [BUG] Segmentation fault ruby 1.9.2p290 (2011-07-09 revision 32553)
> [x86_64-darwin10.8.0]
>
> -- control frame ---------- c:0027 p:-540275480 s:0094 b:0094 l:000093
> d:000093 TOP c:0026 p:---- s:0092 b:0092 l:000091 d:000091 CFUNC
> :require c:0025 p:0174 s:0088 b:0088 l:000087 d:000087 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0024 p:0074 s:0081 b:0081 l:000080 d:000080 TOP
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
> c:0023 p:---- s:0079 b:0079 l:000078 d:000078 FINISH c:0022 p:----
> s:0077 b:0077 l:000076 d:000076 CFUNC :require c:0021 p:0174 s:0073
> b:0073 l:000072 d:000072 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0020 p:0011 s:0066 b:0066 l:000065 d:000065 TOP
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/xml.rb:11
> c:0019 p:---- s:0064 b:0064 l:000063 d:000063 FINISH c:0018 p:----
> s:0062 b:0062 l:000061 d:000061 CFUNC :require c:0017 p:0174 s:0058
> b:0058 l:000057 d:000057 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0016 p:0035 s:0051 b:0051 l:000050 d:000050 TOP
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/happymapper-0.3.2/lib/happymapper.rb:3
> c:0015 p:---- s:0049 b:0049 l:000048 d:000048 FINISH c:0014 p:----
> s:0047 b:0047 l:000046 d:000046 CFUNC :require c:0013 p:0174 s:0043
> b:0043 l:000042 d:000042 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0012 p:0035 s:0036 b:0036 l:000035 d:000035 TOP
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/pivotal-tracker-0.4.1/lib/pivotal-tracker.rb:3
> c:0011 p:---- s:0034 b:0034 l:000033 d:000033 FINISH c:0010 p:----
> s:0032 b:0032 l:000031 d:000031 CFUNC :require c:0009 p:0073 s:0028
> b:0028 l:000024 d:000027 BLOCK
> <internal:lib/rubygems/custom_require>:33 c:0008 p:0014 s:0025 b:0025
> l:000024 d:000024 METHOD <internal:lib/rubygems/custom_require>:29
> c:0007 p:0011 s:0020 b:0020 l:000019 d:000019 TOP
> /Users/isuttle/Projects/amazon_tracker/amzn_iteration.rb:1 c:0006
> p:---- s:0018 b:0018 l:000017 d:000017 FINISH c:0005 p:---- s:0016
> b:0016 l:000015 d:000015 CFUNC :require c:0004 p:0013 s:0012 b:0012
> l:000011 d:000011 METHOD <internal:lib/rubygems/custom_require>:29
> c:0003 p:0011 s:0007 b:0007 l:0014d8 d:001660 EVAL sample.rb:1
> c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000
> s:0002 b:0002 l:0014d8 d:0014d8 TOP
>
> Ruby level backtrace information sample.rb:1:in `<main>'
> <internal:lib/rubygems/custom_require>:29:in `require'
> <internal:lib/rubygems/custom_require>:29:in `require'
> /Users/isuttle/Projects/amazon_tracker/amzn_iteration.rb:1:in `<top
> (required)>' <internal:lib/rubygems/custom_require>:29:in `require'
> <internal:lib/rubygems/custom_require>:33:in `rescue in require'
> <internal:lib/rubygems/custom_require>:33:in `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/pivotal-tracker-0.4.1/lib/pivotal-tracker.rb:3:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/happymapper-0.3.2/lib/happymapper.rb:3:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/xml.rb:11:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml.rb:9:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
It looks like libxml-ruby is the part that is segfaulting. I've had this before when system libraries have been updated possibly by:
System update (e.g. Snow Leopard to Lion)
Package updates (e.g. Homebrew, or Macports)
libxml-ruby is compiled against a specific version of the library libxml2, if the library is then updated it will sometimes work for a bit, but generally be unstable (like this). You could try and force it to recompile by doing something like:
$ gem uninstall libxml-ruby
$ gem install pivotal-tracker

Resources