Posts Tagged ‘ruby’

Ruby’n Rails AASM or state machine

I wanted to use a state machine plugin for my Order model and found that ttilley-aasm was a good fit for me. Here is how I installed it: RAILS_ROOT/config/environmet.rb config.gem ‘ttilley-aasm’, :source => ‘http://gems.github.com’, :lib => ‘aasm’ # rake gems:install # ./script/generate migration add_aasm_state_to_Order aasm_state:string # rake db:migrate And now how I test that it [...]

Continue reading »

mysql gem and mysql NOT from RPM

Have you ever seen this: >> require ‘mysql’LoadError: libmysqlclient.so.15: cannot open shared object file: No such file or directory – /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require’ from (irb):2 I found this happens when your environment for mysql is not setup correctly. The fix is easy. All [...]

Continue reading »

Follow

Get every new post delivered to your Inbox.