From: Christian Fazzini Date: 2011-02-19T22:57:25+09:00 Subject: [ruby-core:35313] [Ruby 1.9-Bug#4373] http.rb:677: [BUG] Segmentation fault --mimepart_4d5fcb8750c02_5986cd8ca50121a9 Content-Type: text/plain Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline Issue #4373 has been updated by Christian Fazzini. File Gemfile added Ok, I have pinpointed the problem. I do not need to move /opt. To diagnos= e this, I created a new rails app. I have included the gem file. In there= you will see that it includes the twitter gem. HOWEVER, I've commented l= ine 9: gem 'pg'. Which I will explain why, later on. The following now works, through these steps: sudo mv /opt /opt_old < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] rvm install 1.9.2 Installing Ruby from source to: /Users/Chris/.rvm/rubies/ruby-1.9.2-p136,= this may take a while depending on your cpu(s)... ruby-1.9.2-p136 - #fetching = ruby-1.9.2-p136 - #downloading ruby-1.9.2-p136, this may take a while dep= ending on your connection... % Total % Received % Xferd Average Speed Time Time Time C= urrent Dload Upload Total Spent Left S= peed 100 8612k 100 8612k 0 0 36861 0 0:03:59 0:03:59 --:--:-- = 26126 ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /Users/Chris/.rvm/src/ru= by-1.9.2-p136 ruby-1.9.2-p136 - #extracted to /Users/Chris/.rvm/src/ruby-1.9.2-p136 ruby-1.9.2-p136 - #configuring = ruby-1.9.2-p136 - #compiling = ruby-1.9.2-p136 - #installing = ruby-1.9.2-p136 - Updating #rubygems to the latest. Removing old Rubygems files... Installing rubygems dedicated to ruby-1.9.2-p136... Retrieving rubygems-1.5.2 % Total % Received % Xferd Average Speed Time Time Time C= urrent Dload Upload Total Spent Left S= peed 100 286k 100 286k 0 0 34987 0 0:00:08 0:00:08 --:--:-- = 60846 Extracting rubygems-1.5.2 ... Installing rubygems for /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/bin/ruby= Installation of rubygems completed successfully. ruby-1.9.2-p136 - Updating #rubygems to the latest. Removing old Rubygems files... Installing rubygems dedicated to ruby-1.9.2-p136... Installing rubygems for /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/bin/ruby= Installation of rubygems completed successfully. ruby-1.9.2-p136 - adjusting #shebangs for (gem irb erb ri rdoc testrb rak= e). ruby-1.9.2-p136 - #importing default gemsets (/Users/Chris/.rvm/gemsets/)= Install of ruby-1.9.2-p136 - #complete = rvm use 1.9.2 Using /Users/Chris/.rvm/gems/ruby-1.9.2-p136 ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0] cd Sites/blog bundle install /Library/Ruby/Site/1.8/rubygems.rb:861:in `report_activate_error': Could = not find RubyGem bundler (>=3D 0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:255:in `activate' from /Library/Ruby/Site/1.8/rubygems.rb:1204:in `gem' from /usr/bin/bundle:18 gem install bundler Fetching: bundler-1.0.10.gem (100%) Successfully installed bundler-1.0.10 1 gem installed Installing ri documentation for bundler-1.0.10... Installing RDoc documentation for bundler-1.0.10... bundle install Fetching http://github.com/jnunemaker/twitter.git remote: Counting objects: 5780, done. remote: Compressing objects: 100% (2157/2157), done. remote: Total 5780 (delta 3834), reused 5267 (delta 3469) Receiving objects: 100% (5780/5780), 1.68 MiB | 185 KiB/s, done. Resolving deltas: 100% (3834/3834), done. Fetching source index for http://rubygems.org/ Using rake (0.8.7) = Installing abstract (1.0.0) = Installing activesupport (3.0.3) = Installing builder (2.1.2) = Installing i18n (0.5.0) = Installing activemodel (3.0.3) = Installing erubis (2.6.6) = Installing rack (1.2.1) = Installing rack-mount (0.6.13) = Installing rack-test (0.5.7) = Installing tzinfo (0.3.24) = Installing actionpack (3.0.3) = Installing mime-types (1.16) = Installing polyglot (0.3.1) = Installing treetop (1.4.9) = Installing mail (2.2.15) = Installing actionmailer (3.0.3) = Installing arel (2.0.7) = Installing activerecord (3.0.3) = Installing activeresource (3.0.3) = Installing addressable (2.2.4) = Using bundler (1.0.10) = Installing multipart-post (1.1.0) = Installing faraday (0.5.4) = Installing faraday_middleware (0.3.2) = Installing hashie (1.0.0) = Installing multi_json (0.0.5) = Installing multi_xml (0.2.1) = Installing thor (0.14.6) = Installing railties (3.0.3) = Installing rails (3.0.3) = Installing simple_oauth (0.1.4) = Using twitter (1.1.2) from http://github.com/jnunemaker/twitter.git (at m= aster) = Your bundle is complete! Use `bundle show [gemname]` to see where a bundl= ed gem is installed. ruby -r twitter -e 'puts Twitter.user("sferik").location' :29:in `require': no such file to l= oad -- twitter (LoadError) from :29:in `require' gem install twitter Fetching: twitter-1.1.2.gem (100%) Successfully installed twitter-1.1.2 1 gem installed Installing ri documentation for twitter-1.1.2... Installing RDoc documentation for twitter-1.1.2... ruby -r twitter -e 'puts Twitter.user("sferik").location' San Francisco rails c ruby-1.9.2-p136 :001 > Twitter.user("sferik").location =3D> "San Francisco" = --------------- In the gem file, if I uncomment line 9: gem 'twitter' and then do bundle = install. In console, running ruby -r twitter -e 'puts Twitter.user("sferi= k").location' still works. = However when I go into rails console, Twitter.user("sferik").location ret= urns the segfault error. I suspect that it has something to do with the way I installed PostgreSql= , via macports. You will notice, when I do: sudo port uninstall openssl, = it says: Warning: port definitions are more than two weeks old, consider using sel= fupdate ---> Unable to uninstall/deactivate openssl @1.0.0c_0, the following por= ts depend on it: ---> postgresql83 @8.3.13_0 ---> python27 @2.7.1_1 Error: Target org.macports.uninstall returned: Please uninstall the ports= that depend on openssl first. Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macpor= ts_registry_portfiles_openssl_1.0.0c_0/main.log Warning: Failed to execute portfile from registry for openssl @1.0.0c_0 ---> Unable to uninstall/deactivate openssl @1.0.0c_0, the following por= ts depend on it: ---> postgresql83 @8.3.13_0 ---> python27 @2.7.1_1 Error: port uninstall failed: Please uninstall the ports that depend on o= penssl first. I believe that the problem occurs because: - Rails includes the pg gem, which is using the openssl version of macpor= ts and not the OSX default openssl. = The next approach I will take, is to uninstall postgresql and openssl thr= ough macports and reinstall postgresql to be configured to use OSX defaul= t openssl. I don't know if I can install postgresql to use OSX default op= enssl, but I will give it a shot and report my findings here. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4373 ---------------------------------------- http://redmine.ruby-lang.org --mimepart_4d5fcb8750c02_5986cd8ca50121a9 Content-Type: application/octet-stream; name=Gemfile Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename=Gemfile c291cmNlICdodHRwOi8vcnVieWdlbXMub3JnJwoKZ2VtICdyYWlscycsICcz LjAuMycKCiMgQnVuZGxlIGVkZ2UgUmFpbHMgaW5zdGVhZDoKIyBnZW0gJ3Jh aWxzJywgOmdpdCA9PiAnZ2l0Oi8vZ2l0aHViLmNvbS9yYWlscy9yYWlscy5n aXQnCgojIGdlbSAnc3FsaXRlMy1ydWJ5JywgOnJlcXVpcmUgPT4gJ3NxbGl0 ZTMnCiNnZW0gJ3BnJwoKIyBVc2UgdW5pY29ybiBhcyB0aGUgd2ViIHNlcnZl cgojIGdlbSAndW5pY29ybicKCiMgRGVwbG95IHdpdGggQ2FwaXN0cmFubwoj IGdlbSAnY2FwaXN0cmFubycKCiMgVG8gdXNlIGRlYnVnZ2VyIChydWJ5LWRl YnVnIGZvciBSdWJ5IDEuOC43KywgcnVieS1kZWJ1ZzE5IGZvciBSdWJ5IDEu OS4yKykKIyBnZW0gJ3J1YnktZGVidWcnCiMgZ2VtICdydWJ5LWRlYnVnMTkn CgojIEJ1bmRsZSB0aGUgZXh0cmEgZ2VtczoKIyBnZW0gJ2JqJwojIGdlbSAn bm9rb2dpcmknCiMgZ2VtICdzcWxpdGUzLXJ1YnknLCA6cmVxdWlyZSA9PiAn c3FsaXRlMycKIyBnZW0gJ2F3cy1zMycsIDpyZXF1aXJlID0+ICdhd3MvczMn CgojIEJ1bmRsZSBnZW1zIGZvciB0aGUgbG9jYWwgZW52aXJvbm1lbnQuIE1h a2Ugc3VyZSB0bwojIHB1dCB0ZXN0LW9ubHkgZ2VtcyBpbiB0aGlzIGdyb3Vw IHNvIHRoZWlyIGdlbmVyYXRvcnMKIyBhbmQgcmFrZSB0YXNrcyBhcmUgYXZh aWxhYmxlIGluIGRldmVsb3BtZW50IG1vZGU6CiMgZ3JvdXAgOmRldmVsb3Bt ZW50LCA6dGVzdCBkbwojICAgZ2VtICd3ZWJyYXQnCiMgZW5kCgpnZW0gJ3R3 aXR0ZXInLCA6Z2l0ID0+ICdodHRwOi8vZ2l0aHViLmNvbS9qbnVuZW1ha2Vy L3R3aXR0ZXIuZ2l0Jwo= --mimepart_4d5fcb8750c02_5986cd8ca50121a9--