ru Русский

Reticularium

NETWORKS PLACE

Useful to sync gems across servers. Converts gem list --local output to a bunch of gem install commands. Rails related gems are removed from the initial list.


gem list --local | grep -v '\*' | grep -v ^$ | grep -v ^action | grep -v ^active | grep -v ^rails | grep -v ^rack | grep -v ^rake | sed 's|(|-v=|' | sed 's|)||' | sed 's|^\(.*\),|\1\n\1|' | sed 's|=.*[[:space:]]|=|' | sed 's|^|gem install |'

In fact, it isn’t. Let me explain.

When you see the next time a complaint like this, note what exactly that complaint is related to. I mean operating system. I am sure you’ll find out that it’s some sort of binary distributives like Centos or Ubuntu. But they are not exactly Linux! They are what they are: Linux-based operating systems distributable in binary form. You can’t refer to them as to Linux, because 1) Linux is a kernel, not an operation system, and 2) being a monolithic kernel, it’s supposed to be carefully configured and compiled natively for each system. And operating system (GNU), should be compiled against this kernel. And the whole toolchain, too.

You might say, well, why does it matter? Is there any difference?

Yes, there is, and it’s huge. Let me show you.

Read the article

Just to save for future use..

passenger-memory-stats | sed 's|[^[:print:]]||g' | sed 's|\[44m\[1m\[33m||g' | sed 's|\[37m||g' | sed 's|\[0m||g'

I wonder why at all they use colors for the output. Since it’s the only way for Passenger based setups to get some info about memory usage, its output should have at least plain text option to be used in other scripts.

It’s a 2.3 bug still not fixed in 2.3.4 gems according to this thread

On my new server with Rails 2.3.4 installed it looks like this:

I run script/plugin install git://github.com/whatever/plugin.git and then just nothing happens.

Recipe from above mentioned thread works for me, so I have to run instead:


script/plugin install http://github.com/whatever/plugin.git/

Note slash at the end!

Quite a common mistake.

Never use :update option of PrototypeHelper methods (like link_to_remote) together with RJS templates. Simply remove :update and RJS will care about it. Another option is to avoid using RJS if possible.

Had to spend some time to figure out:


Person.find :all, :conditions => [ "user_name = ? AND surname = ? AND address = ?", user_name, surname, address]