‹ jan0sch.de

Tags / Ruby

If you’re using Chef on FreeBSD you might stumble upon the following error message when using the knife command.

If you try to install the nokogiri gem on freebsd you may get the following error message:

Since some time you probably noticed ugly deprecation warning made by mocha if using rspec and rails. Usually they look like this:

To prevent the log files of a rails application to grow without limit you should setup log rotation. There are several ways to do this. Here is a simple solution using logrotate.

When running rspec you usually have to wait for all tests to be finnished before you can see the failed tests.

Building an admin interface for your rails application using activeadmin goes quick and easy. Some more work is required if you want to integrate with CanCan.

Since some time it seems to be somewhat impossible to install the ruby-debug gem into your rails app. The error message will most likely look similar to this one:

When testing has_and_belongs_to_many models using rspec and factory girl you should setup your factory the following way:

If you are using heroku you probably ran into some issues with rake assets:precompile. When using active admin bringing it’s assets into your app can also be quite tricky.

The method of precompiling your assets yourself and adding them to your git repository works for sure but it isn’t really best practice.

Another way to get the needed assets to be compiled is as follows:

If you’re using cucumber you should be carefully examining your tests to make sure you’re really writing acceptance tests and not integration tests.

If you want to use another test framework for rails like rspec and factories instead of fixtures. You should adapt config/application.rb as follows:

« ältere Beiträge neuere Beiträge »