Weird errors: dlsym(0x256ee10, Init_mysql): symbol not found - /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
It turned out I had installed the x86_64 version of MySQL and it does not work with Ruby.
[BLATANT COPY/PASTE BEGIN]
0. In Terminal: ls -l /usr/local ## Showed that mysql was pointing to a PowerPC version instead of i686
1. EXPORT ALL DATABASES FROM CURRENT MYSQL
2. Downloaded MySQL 5.1.30 (I am on OS X 10.4.11 so I used Mac OS X 10.4 (x86))
3. Ran installation package (be sure to see the README first about stopping current server, etc)
4. In Terminal: sudo gem uninstall mysql
5. In Terminal: sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
6. Started up my app's script/server
[BLATANT COPY/PASTE END]
Source: RailsForum
Tuesday, December 30, 2008
Saturday, December 20, 2008
Captcha in Rails 2.1.2
Simple Captcha plugin by Sur Max works great. Few things that has made life easier:
1. You can now install the RMagick on Linux and Mac OS X using gem install rmagick.
2. Just follow the readme file that comes with the plugin and things will work fine.
It still is in SVN repository. It's ok, just install it.
1. You can now install the RMagick on Linux and Mac OS X using gem install rmagick.
2. Just follow the readme file that comes with the plugin and things will work fine.
It still is in SVN repository. It's ok, just install it.
Thursday, November 20, 2008
Phusion Passenger Enterprise Ruby
If you're using Phusion Passenger (http://www.modrails.com),
and you want it to use Ruby Enterprise Edition, then edit your Apache
configuration file, and change the 'PassengerRuby' option:
PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby
If you ever want to uninstall Ruby Enterprise Edition, simply remove this
directory:
/opt/ruby-enterprise-1.8.6-20080810
and you want it to use Ruby Enterprise Edition, then edit your Apache
configuration file, and change the 'PassengerRuby' option:
PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby
If you ever want to uninstall Ruby Enterprise Edition, simply remove this
directory:
/opt/ruby-enterprise-1.8.6-20080810
Wednesday, November 19, 2008
Tuesday, November 18, 2008
ssh keys setup - passwordless login from multiple machines
Append id_rsa.pub value in a new line (if there is already another entry) to the ~/.ssh/authorized_keys in the remote machine.
Thursday, November 06, 2008
no such file to load -- mysql (MissingSourceFile)
I followed the Hivelogic tutorial to install MySQL. I was getting that error message when I do:
sudo gem install mysql
To get this to work run:
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
[All in one line]
sudo gem install mysql
To get this to work run:
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
[All in one line]
Tuesday, November 04, 2008
WARNING: RubyGems 1.2+ index not found for:
RubyGems will revert to legacy indexes degrading performance.
I was getting this error message while upgrading from Rails 2.1.1 to 2.1.2. Just add github as another gem source.
1. sudo gem sources -a http://gems.github.com
2. sudo gem install rails --version 2.1.2
I was getting this error message while upgrading from Rails 2.1.1 to 2.1.2. Just add github as another gem source.
1. sudo gem sources -a http://gems.github.com
2. sudo gem install rails --version 2.1.2
Monday, November 03, 2008
Rails 2.1.1 Htmldoc 0.2.1 PDF generation
I was getting the error:
NoMethodError (undefined method `size' for false:FalseClass):
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/streaming.rb:123:in
`send_data'
Patch the file :
/usr/local/lib/ruby/gems/1.8/gems/htmldoc-0.2.1/lib/htmldoc.rb
with the following:
result.split("\n").each do |line|
+ line.strip!
Reference:
http://textmode.at/2008/5/14/ruby-htmldoc-gem-falseclass-error
NoMethodError (undefined method `size' for false:FalseClass):
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/streaming.rb:123:in
`send_data'
Patch the file :
/usr/local/lib/ruby/gems/1.8/gems/htmldoc-0.2.1/lib/htmldoc.rb
with the following:
result.split("\n").each do |line|
+ line.strip!
Reference:
http://textmode.at/2008/5/14/ruby-htmldoc-gem-falseclass-error
Wednesday, October 29, 2008
Using HTTPS in RESTful authentication Rails 2.1.1
If you get the error message:
ActionController::UnknownAction (No action responded to show):
In the sessions controller make sure you have :
ssl_required :new, :create
This will now enable https when someone logins in to the site. All other details can be easily found via Google.
ActionController::UnknownAction (No action responded to show):
In the sessions controller make sure you have :
ssl_required :new, :create
This will now enable https when someone logins in to the site. All other details can be easily found via Google.
Monday, October 27, 2008
Tagging in Rails 2.1
I had to migrate from Acts As Taggable on Steroids to Acts As Taggable On plugin to get tagging working Rails 2.1.
One migration issue is that context column that is added by this plugin will be null for old data. It must be set to 'tags' for listing tags for a given model. This will make #tag_list display all the tags for that particular model.
One migration issue is that context column that is added by this plugin will be null for old data. It must be set to 'tags' for listing tags for a given model. This will make #tag_list display all the tags for that particular model.
Wednesday, October 01, 2008
Dream Machine
I got my Mac Pro 3.2 GHz 2 processor quad core with 16 GB RAM and RAID enabled 15000 rpm SAS drive on oct 29. I am experimenting with 3 monitor setup, two 30 inch Apple Cinema displays and one Samsung 22 inch display.
Let's see how much productivity I can get from this new setup. Only gripe is the hissing noise of the fan. I don't know if it has to do with the SAS drive. I will post my setup photo on rubyplus.org soon.
Let's see how much productivity I can get from this new setup. Only gripe is the hissing noise of the fan. I don't know if it has to do with the SAS drive. I will post my setup photo on rubyplus.org soon.
Thursday, September 11, 2008
Secret to a Developer's Success
In a interview with LinuxDevCenter.com, Matz was asked the "future plans for Ruby", he replied:
loop do
read and reply mails
write code
write document/article/book
write code
end
I think this is an excellent plan to succeed for a developer who is passionate about software development.
loop do
read and reply mails
write code
write document/article/book
write code
end
I think this is an excellent plan to succeed for a developer who is passionate about software development.
Tuesday, September 09, 2008
Integrate ActiveMerchant With Rails
I read the Integrate ActiveMerchant With Rails recipe in the book Enterprise Rails Recipes by Maik Schmidt. This recipe is basically a recipe for disaster.
In a real web application the user must be taken out of the loop as soon as possible. Having a spinner spining or disabling the button or saying don't click the button is a bad design. Take Amazon for instance the user experience on the site is a good example to follow.
As soon as you create an order, you must set it's initial state and process that order in the background. You can use run rake task using a CRON job that processes the orders. What happens if the Gateway is down? What will you recover from network errors? These things happen in the real world and your software that affect the bottom line must be able to handle it.
In a real web application the user must be taken out of the loop as soon as possible. Having a spinner spining or disabling the button or saying don't click the button is a bad design. Take Amazon for instance the user experience on the site is a good example to follow.
As soon as you create an order, you must set it's initial state and process that order in the background. You can use run rake task using a CRON job that processes the orders. What happens if the Gateway is down? What will you recover from network errors? These things happen in the real world and your software that affect the bottom line must be able to handle it.
Monday, August 25, 2008
Winner of Rubyplus.org Rails Documentation Contest
There was only one entry to the contest! That entry was from a prolific Rails contributor Xavier Noria Rami. Congratulations Xavier and keep up the good work.
I will be shipping him a brand new iPhone 3g soon!
I will be shipping him a brand new iPhone 3g soon!
Wednesday, August 13, 2008
LaunchBox Unleashes Its First Nine Startups
None of those startup are likely to make any money.
Here is an idea for a startup that can make money:
How about a web app / iPhone app that users can use to check how likely they can get a room with a certain rating in a given location and date? Business travelers will find it very helpful.
Here is an idea for a startup that can make money:
How about a web app / iPhone app that users can use to check how likely they can get a room with a certain rating in a given location and date? Business travelers will find it very helpful.
Friday, August 08, 2008
Eric Hodel 3000 Logger `load_missing_constant': uninitialized constant Hodel3000CompliantLogger
Rails 2.0 configuration for Hodel 3000 logger blows up in environment.rb. Switching to RAWK. It would be cool to have a Capistrano task that shows the output.
Tuesday, July 29, 2008
Ultrasphinx on Centos
1. yum install bison
2. yum install gcc-c++
3. wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
4. tar xvf sphinx-x.y.z
5. cd sphinx.x.y.z
6. ./configure
7. make
8. sudo make install
You also need chronic and hpricot gems on your system.
2. yum install gcc-c++
3. wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz
4. tar xvf sphinx-x.y.z
5. cd sphinx.x.y.z
6. ./configure
7. make
8. sudo make install
You also need chronic and hpricot gems on your system.
Tuesday, July 22, 2008
Ultrasphinx Search Engine with Rails 2.0.2
ultrasphinx: Anonymous modules have no name to be referenced by
This error is caused due to the autoloading failing to load the required Ultrasphinx files in Rails 2.0.2. The following is the fix:
1. require 'ultrasphinx/fields' in ultrasphinx/configure.rb
2.
production.conf
source episodes_main
{
html_strip = 1
}
index main
{
strip_html = 0
}
3.
In environment.rb
config.after_initialize do
Ultrasphinx::Configure.load_constants
end
Notes:
git clone git://github.com/DrMark/ultrasphinx.git vendor/plugins/ultrasphinx
rm -rf vendor/plugins/ultrasphinx/.git
This error is caused due to the autoloading failing to load the required Ultrasphinx files in Rails 2.0.2. The following is the fix:
1. require 'ultrasphinx/fields' in ultrasphinx/configure.rb
2.
production.conf
source episodes_main
{
html_strip = 1
}
index main
{
strip_html = 0
}
3.
In environment.rb
config.after_initialize do
Ultrasphinx::Configure.load_constants
end
Notes:
git clone git://github.com/DrMark/ultrasphinx.git vendor/plugins/ultrasphinx
rm -rf vendor/plugins/ultrasphinx/.git
Tuesday, July 08, 2008
How Google reinvented Ruby Hash or Protocol Buffers by Google
I was laughing out aloud when I saw the following example on Protocol Buffers:
person {
name = "John Doe"
email = "jdoe@example.com"
}
How close is it to Ruby?
person => {
name => "John Doe"
email => "jdoe@example.com"
}
person {
name = "John Doe"
email = "jdoe@example.com"
}
How close is it to Ruby?
person => {
name => "John Doe"
email => "jdoe@example.com"
}
Thursday, June 19, 2008
Subscribe to:
Posts (Atom)