WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.9.1

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You get the following warning after an update to your system (ie Ubuntu 13.10):

Solution

Uninstall your nokogiri versions:

and then run install it again (inside your application if you use bundler) with:

rvm “You need to change your terminal emulator preferences to allow login shell.”

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

After a new rvm installation in an (k)ubuntu system you get the following error from rvm when trying to switch between rubies:

Solution

As the message suggests you can change the setting in your terminal which is fine if you are using the gnome-terminal by going to the link provided:

but if you are using Konsole in KDE you need to go to a different link that explains the change in the settings:

db:migrate or db:schema:load for Rails project with many migations

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You have a rails application with many migrations build over time and you want to recreate the database from start. Should you be using the normal way of running the migrations (db:migrate) or the one that loads the actual schema to the database (db:schema:load).

Solution

According to the book Rails 4 in Action (MEAP v9 page 146) :

The bin/rake db:migrate task runs the migrations and then dumps the structure of the database to a file called db/schema.rb. This structure allows you to restore your database using the bin/rake db:schema:load task if you wish, which is better than running all the migrations on a large project again! NOTE

NOTE: Large projects can have hundreds of migrations, which may not run due to changes in the system over time. It’s best to just use the bin/rake db:schema:load.