Wednesday, March 14, 2012
Sunday, March 4, 2012
Morning comes as pure delight
After spending the night working, I went for a ride along the Tel Aviv shore line. The sky was a bit clearer after the heavy rain.
Rinsing rain, under skies so bright,
Sleep all day and work all night
Morning comes as pure delight
I hope I'll manage to do some testing before my head crashes into the keyboard.
Rinsing rain, under skies so bright,
Sleep all day and work all night
Morning comes as pure delight
I hope I'll manage to do some testing before my head crashes into the keyboard.
Thursday, March 1, 2012
Installing RoR 3.x on Ubuntu 10.4 with MySQL
I'm writing this as a reminder for myself.
To install Rails (3.x) on Ubuntu 10.4 with a MySQL gem do the following:
sudo su
apt-get install build-essential
apt-get install ruby rdoc libopenssl-ruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo apt-get install ruby1.8-dev
gem install rails
After creating the application using
rails new myApplicationName -d mysql
Running the rake db:migrate will result in error, since it requires a JS engine.
To fix that, edit the Gemfile in the application directory and add the following lines:
gem 'execjs'
gem 'therubyracer'
and then run
bundle install
* Another option is to install NodeJS on the machine, as the javascript engine by following these steps:
To install Rails (3.x) on Ubuntu 10.4 with a MySQL gem do the following:
sudo su
apt-get install build-essential
apt-get install ruby rdoc libopenssl-ruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo apt-get install ruby1.8-dev
gem install rails
To install the MySQL gem:
apt-get install ruby-dev libmysql-ruby libmysqlclient-dev
gem install mysql
After creating the application using
rails new myApplicationName -d mysql
Running the rake db:migrate will result in error, since it requires a JS engine.
To fix that, edit the Gemfile in the application directory and add the following lines:
gem 'execjs'
gem 'therubyracer'
and then run
bundle install
* Another option is to install NodeJS on the machine, as the javascript engine by following these steps:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
.Friday, January 20, 2012
Sunday, October 16, 2011
Mysql2::Error (Invalid date: xx) on a text field?!
I have this rule, the longer it takes to figure out a bug, the dumber the solution is going to be. This one was no exception.This bug on the rails adapter for mysql (the native Mysql2 for Windows) cost me a day and a half of bewilderment.
The symptoms were that when populating a particular field in a table caused the created_at filed that was directly after to corrupt.
Although the entry would save successfully, once i tried to retrieve it, it would omit an argument error, without any explanations or indication to the field that was causing the problem.
After literally hours spent reinstalling and reconfiguring and redeploying my application and the run times involves i stumbled upon this error "Mysql2::Error (Invalid date: xx)" where xx was the text value of the field preceding the "created_at" standard field.
A quick search on Google pointed me to the bug in Mysql2.
My solution was (cross my heart and hope to die) was to add an extra field that i never populate before the date fields.
Good Luck.
The symptoms were that when populating a particular field in a table caused the created_at filed that was directly after to corrupt.
Although the entry would save successfully, once i tried to retrieve it, it would omit an argument error, without any explanations or indication to the field that was causing the problem.
After literally hours spent reinstalling and reconfiguring and redeploying my application and the run times involves i stumbled upon this error "Mysql2::Error (Invalid date: xx)" where xx was the text value of the field preceding the "created_at" standard field.
A quick search on Google pointed me to the bug in Mysql2.
My solution was (cross my heart and hope to die) was to add an extra field that i never populate before the date fields.
Good Luck.
Wednesday, August 24, 2011
Switching between Ruby Runtime versions on Windows
A nice tool for switching between ruby versions on windows is the pik gem
To use it, run gem install pik
Install locally by running: pik_install C:\pik
And add the installation dir (in this case c:\pik) to your system path.
Once you have that set up, you add ruby installations by running pik add C:\Ruby192\bin
and switch between them by pik 192
Subscribe to:
Posts (Atom)

