rvm libz.1.2.5.dylib and zlib on Mac

Got stuck on this while following Setting up a fresh Rails 3.1 project safely and Upgrading to Rails 3 Part 1. Took the first tutorial’s tip on setting up rvm per project or per application, the latter is for the upgrade procedure.

I have 1.8.7 and 1.92 rubies installed, and the app I was upgrading is from 2.2.x. I’ve setup a new .rvmrc on the app folder so it automatically uses 1.9.2. Though in the upgrade tutorial you have to do it manually by calling rvm 1.9.2 or rvm system, my setup already loads 1.9.2 and to switch to 1.8.7 I’ll just issue rvm system.

On the part where I run gem install rails from upgrading to rails 3, I get this error:

$ Irb ruby-1.9.2-p180: 001>
  require 'zlib' LoadError: dlopen(/Users/user1/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-darwin10.7.0/zlib.bundle, 9): Library not loaded: libz.1.2.5.dylib
  Referenced from: /Users/user1/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-darwin10.7.0/zlib.bundle
  Reason: image not found - /Users/user1/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-darwin10.7.0/zlib.bundle
  from /Users/user1/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb: 36: in `require'
  from (irb): 1 from /Users/user1/.rvm/rubies/ruby-1.9.2-p180/bin/irb: 16: in`<main>'

I tried a lot of rvm docs, gem uninstall-install, gem update, switching apps and even sudo’ing (yeah I know, it defies the purpose of using rvm), but no dice. To cut the story short, the fix was DYLD_FALLBACK_LIBRARY_PATH

export DYLD_FALLBACK_LIBRARY_PATH = $HOME/.rvm/usr/lib/

This can be in your bash profile or in .rvmrc, in case this only happens on one of you apps.

export DYLD_FALLBACK_LIBRARY_PATH = $rvm_path/usr/lib/

Found the answer here http://apribase.net/2010/11/13/macports-dyld_library_path/ (it’s in Japanese though, just use G translate). Hope this helps.

Oh, I’ll update this as well for the Mac setup I use in the office plus the gem env.

Update:

System

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.4.0]
  - INSTALLATION DIRECTORY: /Users/ubertordev2/.rvm/gems/ruby-1.8.7-p334
  - RUBY EXECUTABLE: /Users/ubertordev2/.rvm/rubies/ruby-1.8.7-p334/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/ubertordev2/.rvm/gems/ruby-1.8.7-p334/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-10
  - GEM PATHS:
     - /Users/ubertordev2/.rvm/gems/ruby-1.8.7-p334
     - /Users/ubertordev2/.rvm/gems/ruby-1.8.7-p334@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

rvmrc

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin10.4.0]
  - INSTALLATION DIRECTORY: /Users/ubertordev2/.rvm/gems/ruby-1.9.2-p290
  - RUBY EXECUTABLE: /Users/ubertordev2/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/ubertordev2/.rvm/gems/ruby-1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-10
  - GEM PATHS:
     - /Users/ubertordev2/.rvm/gems/ruby-1.9.2-p290
     - /Users/ubertordev2/.rvm/gems/ruby-1.9.2-p290@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Location based reminders

Just realized the usefulness of location based reminders that’s going to be released with the launch of new iOS 5, and that i felt the need to write something about it.

Well, for me, I often forgot something what interests me on certain places. Or even if someone asks me to grab something for them if I visit a place, town or province the next time. This app, if it works, should alert me of what stuff I need to grab while I’m at some place. This is one the reasons I am excited with the launch of iOS 5.

I wonder though, if it’s ever going to be of a purpose to remind “when you leave from a location”, as it would be triggered when you already left, or yes, it may serve some – for you to go back. If I remember correctly, there are triggers for that and “when you arrive at a location”. Or is there another one for “when you’re at a location”? But generally, it has a purpose.

They’re just my thoughts.

On an unrelated note, it’s quite a pain writing on wordpress for iphone, really! I actually updated this app just an hour ago. The cursor always returns back to the end of the content if you position to edit on other parts of the text. Neither it loads auto complete on words. And pressing space twice should add a period, but it doesn’t do that. Why?

Anyways.