How to compile Ruby?

The simple answer is that you can’t, at least with MRI 1.8 (the standard). This is because 1.8 works by walking the Abstract Syntax Tree. Python, Ruby 1.9, JRuby, and Rubinius use byte code, which allows compilation to an Intermediate Representation (byte code). From MRI Ruby 2.3 it has become easy to do this, see … Read more

Ruby Benchmark module: meanings of “user”, “system”, and “real”?

These are the same times that the Unix time command or other typical benchmarking tools would report: user: the amount of time spent executing userspace code (i.e.: your code), system: the amount of time spent executing kernel code and real: the “real” amount of time it took to execute the code (i.e. system + user … Read more

Ruby Inspect readability?

The ruby standard library contains PP (short for “Pretty Print”), which formats structures much better than the standard inspect: http://www.ruby-doc.org/stdlib/libdoc/pp/rdoc/index.html You need to require ‘pp’ at the top of your source file before you can use it, and then just replace p obj with pp obj in your code. I find it really useful for … Read more

how to make a gemset in RVM the default?

Have you tried specifying rvm –default use after the gemset is created so passing: rvm –default use [email protected] and then seeing if that sticks? Using create and default at the same time isn’t something I’ve tried before, it’s the only thing that strikes me as out of place. Given the discussion below I’d offer this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)