Wednesday, August 24, 2011

Getting error "couldn't load file "/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib" while installing MacPort

Installed MacPorts from the DMG package at http://www.macports.org/install.php
After installing it, when tried to check the port version or install ImageMagick displaying error:

:restaurant ror$ sudo port install ImageMagick
couldn't load file "/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib": dlopen(/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib, 10): no suitable image found.  Did find:
    /opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib: unknown required load command 0x80000022
    while executing
"load /opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib"
    ("package ifneeded" script)
    invoked from within
"package require macports"
    (file "/opt/local/bin/port" line 38)


Solution to fix this problem:
Installed it from source

tar xjvf MacPorts-2.0.1.tar.bz2
cd MacPorts-2.0.1
./configure && make && sudo make install
sudo port -v selfupdate

Now you can check port version by command:
              port version
which will give you
             Version: 2.0.1

Installing ImageMagick on Mac

Installing ImageMagick on Mac is done very easily using MacPorts.
First Install MacPorts from source given at ' http://www.macports.org/install.php'
And then install ImageMagick

To install MacPort:
1. Download source from  ' http://www.macports.org/install.php'
2. tar xjvf MacPorts-2.0.1.tar.bz2
3. cd MacPorts-2.0.1
4  ./configure && make && sudo make install
5. sudo port -v selfupdate

You can check the port version by command "port verison"

To install ImageMagick
After successfully installing port, run the command:
-   sudo port install ImageMagick
to install ImageMagick

Tuesday, August 23, 2011

Getting error "`require': no such file to load -- pony (LoadError)" in SMSFu with Rails 3.0.5

I am integrating SMS system with Rails 3.0.5. As we wanted a free solution for sending SMS, we went through SMSFu. But when we tried to run the application after installing 'sms_fu', faced issues which was patched and now able to run the Rails 3.0.5 application with SMSFu. Here are the details:

Installed Plugin:
git clone git://github.com/brendanlim/sms-fu.git vendor/plugins/sms_fu  
And tried to start the server, got following error:

 -:restaurant ror$ rails s
=> Booting WEBrick
=> Rails 3.0.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- pony (LoadError)
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/vendor/plugins/sms_fu/lib/sms_fu.rb:2:in `<top (required)>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/vendor/plugins/sms_fu/rails/init.rb:1:in `block in <class:Plugin>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/plugin.rb:81:in `eval'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/plugin.rb:81:in `block in <class:Plugin>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `block in run_initializers'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
    from /Users/ror/projects/restaurant/config/environment.rb:6:in `<top (required)>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/config.ru:3:in `block in <main>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
    from /Users/ror/projects/restaurant/config.ru:1:in `new'
    from /Users/ror/projects/restaurant/config.ru:1:in `<main>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands/server.rb:65:in `start'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:30:in `block in <top (required)>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Then I tried to run the application with 'sms_fu' gem, in Gemfile added:
gem 'sms_fu'

Executed Bundle install. It installed sms_fu version '1.1.2' successfully, when starting the application gives following errors:

:restaurant ror$ rails s
/Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- pony (LoadError)
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/sms_fu-1.1.2/lib/sms_fu.rb:2:in `<top (required)>'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
    from /Users/ror/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
    from /Users/ror/projects/restaurant/config/application.rb:7:in `<top (required)>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    from /Users/ror/projects/restaurant/highline/ruby/1.9.1/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'



 Solution or you can say workaround to handle this problem:

I commented "require 'pony'" line2 in "vendor/plugins/sms_fu/lib/sms_fu.rb" and then able to run the application.