Using RVM to Isolate RubyGems on Fedora 21

Ruby comes with a rich set of packages, which is named by the community as 'Ruby Gems'. Ruby gems are quite alike python packages. They both have dependencies, they rely on specific interpreter versions, they are both managed by centralized repositories [1].

Just like Python, Fedora 21 comes with several Ruby gems as packages in official repository (they are named 'rubygem-xxx'). But gems in the official repo can be outdated, some gems are missing and there are still other problems which makes the official rubygem package inadequate. The users have to manually install gems, which causes several problems, to name a few:

  1. Gems interfere with system packages.

  2. Some user installed gems does not work properly with system installed gems.

    For example, user install jekyll does not work with system rubygem-json, which stops it from working.

The ideal way to solve the above problem is to setup isolated (possible non-root) ruby environment for specificed purpose. For example, if one managed to setup seperate ruby interpreter and gems for jekyll, problem 2 does not even exists. RVM comes right to the problem.


1. Python have PyPI, ruby have RubyGems

  Read the rest of this post

Fix Argument Error with lvalue In Boost.Python

The problem

Boost.Python is often used to interface c++ classes to python. It’s easy to use, handles c++ string and containers automatically and non-intrusive.

YouCompleteMe uses Boost.Python to export its c++ classes to python so users can use them in their ycm_extra_conf.py file. Recently, I encountered the following strange problem when using CompilationDatabase.GetCompilationFlagsForFile:

ArgumentError: Python argument types in^@
CompilationDatabase.GetCompilationInfoForFile(CompilationDatabase, unicode)^@
did not match pass:[c++] signature:^@
GetCompilationInfoForFile(YouCompleteMe::CompilationDatabase {lvalue},
std::string)^@

  Read the rest of this post