--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 diagnose this, I created a new rails app. I have included the gem file. In thereou will see that it includes the twitter gem. HOWEVER, I've commented line 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,his may take a while depending on your cpu(s)...

ruby-1.9.2-p136 - #fetching uby-1.9.2-p136 - #downloading ruby-1.9.2-p136, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
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/ruby-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 uby-1.9.2-p136 - #compiling uby-1.9.2-p136 - #installing uby-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  Current
                                 Dload  Upload   Total   Spent    Left  Speed
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/rubynstallation 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/rubynstallation of rubygems completed successfully.
ruby-1.9.2-p136 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p136 - #importing default gemsets (/Users/Chris/.rvm/gemsets/)nstall 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 (>= 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) nstalling abstract (1.0.0) nstalling activesupport (3.0.3) nstalling builder (2.1.2) nstalling i18n (0.5.0) nstalling activemodel (3.0.3) nstalling erubis (2.6.6) nstalling rack (1.2.1) nstalling rack-mount (0.6.13) nstalling rack-test (0.5.7) nstalling tzinfo (0.3.24) nstalling actionpack (3.0.3) nstalling mime-types (1.16) nstalling polyglot (0.3.1) nstalling treetop (1.4.9) nstalling mail (2.2.15) nstalling actionmailer (3.0.3) nstalling arel (2.0.7) nstalling activerecord (3.0.3) nstalling activeresource (3.0.3) nstalling addressable (2.2.4) sing bundler (1.0.10) nstalling multipart-post (1.1.0) nstalling faraday (0.5.4) nstalling faraday_middleware (0.3.2) nstalling hashie (1.0.0) nstalling multi_json (0.0.5) nstalling multi_xml (0.2.1) nstalling thor (0.14.6) nstalling railties (3.0.3) nstalling rails (3.0.3) nstalling simple_oauth (0.1.4) sing twitter (1.1.2) from http://github.com/jnunemaker/twitter.git (at master) our bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

ruby -r twitter -e 'puts Twitter.user("sferik").location'
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- twitter (LoadError)
	from <internal:lib/rubygems/custom_require>: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
 => "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("sferik").location' still works. However when I go into rails console, Twitter.user("sferik").location returns 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 selfupdate
--->  Unable to uninstall/deactivate openssl @1.0.0c_0, the following ports depend on it:
--->  	postgresql83 @8.3.13_0
--->  	python27 @2.7.1_1
Error: Target org.macports.uninstall returned: Please uninstall the portshat depend on openssl first.
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_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 ports depend on it:
--->  	postgresql83 @8.3.13_0
--->  	python27 @2.7.1_1
Error: port uninstall failed: Please uninstall the ports that depend on openssl first.

I believe that the problem occurs because:
- Rails includes the pg gem, which is using the openssl version of macports and not the OSX default openssl. The next approach I will take, is to uninstall postgresql and openssl through macports and reinstall postgresql to be configured to use OSX default openssl. I don't know if I can install postgresql to use OSX default openssl, 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--