Mar 4 2009

The Rails Magazine

There are a lot of really great resources about Ruby and Rails on the web but the community was missing resource and articles an offline. In print. In something what you can hold in your hands and read on the tube/plane or wherever you want without the need of a computer.

Until now. The first issue of the Rails Magazine (titled ‘The Beginning’) is out now. Rails Magazine is a real, printed journal covering Rails and the Rails community. Continue reading


Jan 15 2009

Ruby Enterprise Edition 1.8.6-20090113 – another update

Only a bit more than 1 month ago I’ve blogged about another update of Ruby Enterprise Edition. Now it is time for another heads up:

Ruby Enterprise Edition 1.8.6-20090113 is released.

Man, these guys are on fire! If yo are as crazy as I am, you may already been thinking about an update (at least on your development server.) So, let’s see what you can get if you update to this release. Continue reading


Dec 5 2008

Major updates of Ruby Enterprise Edition

A couple of days ago I posted an entry about REE, Rails and Passenger setup.

Today we’ve received an email from Phusion about an updated version of REE:
Ruby Enterprise Edition 20081205 has been released.

This new update seems to address the most common problems what people have been encountering.

The main updates include:

  • Better 64-bit support
  • Better Mac OS X support
  • RubyGems updated to version 1.3.1. (So you don’t need to update RubyGems like in my previous post)
  • REE’s RubyGems no longer makes use of the existing gems (which fixes a lot of confusion and problems with native extensions)
  • Integration with the RailsBench garbage collector patches
  • A new command to track REE updates easily ($ ree-version)

Please visit the official site for more details and the announcement.

To upgrade from a previous version, simply install into the same prefix that you installed to last time. You can follow this guide in my previous post.


Dec 3 2008

How to install Ruby Enterprise Edition, Passenger and Rails 2

There are certain products which are currently shaking the Ruby / Rails community:

  • One of them is the infamous Phusion Passenger which makes deploying Rails applications a piece of a cake using Apache web servers,
  • And Ruby Enterprise Edition (aka REE) which promises better memory management and better scaleability of your Rails applications.

These are really promising projects and Passenger offers a really elegant and automated setup which makes it pretty easy to be installed. However, I still keep seeing people having problems using it with REE and Rails version 2.2.2 on blogs, RailsForum and mostly on IRC.

In this article I will describe how to set up all of them. Hopefully it will help you understand the basic ideology how a Ruby environment is set up.

You will learn how to install and set up the following products for Rails development/deployment:

  • Apache 2.2
  • Ruby Enterprise Edition
  • RubyGems 1.3.1
  • Ruby on Rails 2.2.2
  • Passenger 2.1.0 (note: this is an edge version, not recommended in production environment, you can still use 2.0.4)

What you will need:

  • Apache web server already set up,
  • Root privileges to be able to compile and set up your server
  • A basic understanding how to use the Terminal.

OK, let’s get started. Continue reading


Oct 21 2008

Installing the MySQL gem on OS X

Wanna install the mysql gem for Ruby? You’d better do it since it’s already available, and you will need it anyway from Rails 2.2 since all database adapters are going to be extracted to 3rd party gems. Take a quick look at your development.log file:

cat development.log | grep -i "DEPRECATION WARNING"

You may see a lot of deprecation warnings related to the mysql database connector like these:

DEPRECATION WARNING: You’re using the Ruby-based MySQL library that ships with Rails. This library will be REMOVED FROM RAILS 2.2. Please switch to the offical mysql gem: `gem install mysql` See http://www.rubyonrails.org/deprecation for details. (called from mysql_connection at /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/mysql_adapter.rb:81)

Now you’d better install the mysql gem. I know, it is not a too easy task, a lot of people seem to have problems with it. If you type sudo gem install mysql your Terminal may return with errors:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
	ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Yea, very disappointing I know, I know. But rather then start crying like a teenage girl you could check the error log and start thinking about what you are missing.

No, no, no, I am not talking about a million dollar penthouse or girlfriend in this case… You forgot to tell RubyGems where to look for the mysql header/source files. Without them it just cannot build a native extension on your machine.

Let’s provide some more information to the package manager so it will be able to build that beast on your machine:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

Much better.


May 2 2008

Twitter Said To Be Abandoning Ruby on Rails

There was always a mess and confusion around the scaling abilities of Rails.

We’re hearing this from multiple sources: After nearly two years of high profile scaling problems, Twitter is planning to abandon Ruby on Rails as their web framework and start from scratch with PHP or Java (another solution is to stick with the Ruby language and move away from the Rails framework).

.. as it was written yesterday on Techcrunch.

On the other hand, David Heinemeier Hansson (creator of Ruby On Rails) wrote a post on Loud Thinking (his personal Blog) about the scaling opportunities of the framework.

Well, I am about to dig deeper into this very exciting question and share my experiences.

UPDATE: Just got noticed by Arnold Funken on Twitter:


Dec 12 2007

Rails 2.0 is finally out

Yes, you are right. It is finally finished after about a year in the making. This is a fantastic release that’s absolutely stuffed with great new features, loads of fixes, and an incredible amount of polish. So let’s digg into the new features and everybody: update your stuff to get even more funky!

Update details can be found here.


Nov 16 2007

Problems with RMagick 1.5

Last week one of our webistes went down for some unknown reason, and I’ve found this kind of error message in production.log:

LoadError (Expected xy file to define ...)

Of course this is a useless error message which means Rails couldn’t find a controller file which has been still at its proper path of course. What to do now? If you need a more detailed error log, there is a solution to force Rails to log errors in deeper detail, just set your caching classes to true in your environment.rb file:

config.cache_classes = true

After restarting the webserver, and reloading the page, I could get a proper and useful error message, Rails pointed that the error is in RMagick gems. Take a quick look on the new error message in the log:

RuntimeError (This version of RMagick was created to run with ImageMagick 6.3.3
but ImageMagick 6.3.6 is installed on this system. You should either
1) Configure and build RMagick for ImageMagick 6.3.6, or
2) download ImageMagick 6.3.3 from file:///usr/local/share/doc/ImageMagick-6.3.3/index.html and install it.
):

Now this is something what you can use to start debugging. After reinstalling RMagick, the problem has been solved, and the site was up and online again. Just do the following 3 easy steps:

gem uninstall rmagick
gem install rmagick
apachectl restart

Done, you can get back processing your images.


Nov 1 2007

Rails goes v2.0, shortly

Behold, behold, Rails 2.0 is almost here. Take a quick look here to check out the new killer features. There is a preview version available as well. Must be seen!

Update:

This morning (November 29th) the Rails team has released RC2 so if you are a freak who is keen on the latest builds and wants to check out RC2 – use the svn checkout command of:

svn co http://dev.rubyonrails.org/svn/rails/tags/rel_2-0-0_RC2 vendor/rails

Aug 9 2007

Using Visual Studio as a Ruby On Rails IDE

Microsoft Visual StudioThere are lots of good editors for Ruby development, such as Aptana (formerly known as RadRails) which is based on the Eclipse framework so it needs lots of resources to run (because is is based on Java). An other solution can be RoRED. RoRED seems to be OK, but I really miss lots of features from it.

If I say IDE, I mean a full featured environment with project management, useful editor and debugging features. And this is when Visual Studio comes in. Microsoft’s Visual Studio is one of the most famous IDEs, used by lots of programmers who have to focus on .Net, ASP, C, C++, C#. But what about Ruby developers? Since now it can be used as a Ruby On Rails IDE with a “small extension” built by SapphireSteel Software: Ruby In Steel.

Continue reading