Archiv der Kategorie ‘Ruby on Rails‘

Rails 2.3.5 - Add routes to your app - Really useful for rails engines and plugins

Tuesday, den 4. May 2010

Since Rails 2.3.5 you can easily load new routes to your app anytime. So using
RouteSet#add_configuration_file
to load a separate route file can me extremly useful when creating a rails plugin or engine that needs to define some extra routes.

Rails 3 - Beta - no such file to load — rails/cli (LoadError)

Tuesday, den 27. April 2010

When trying to create a rails project you might encounter the following error:
/Users/jfischer/.rvm/gems/ruby-1.9.1-p378/gems/rails-3.0.0.beta3/bin/rails:1:in `require’: no such file to load — rails/cli (LoadError)
from /Users/jfischer/.rvm/gems/ruby-1.9.1-p378/gems/rails-3.0.0.beta3/bin/rails:1:in `<top (required)>’
from /Users/jfischer/.rvm/gems/ruby-1.9.1-p378/bin/rails:19:in `load’
from /Users/jfischer/.rvm/gems/ruby-1.9.1-p378/bin/rails:19:in `<main>’
The problem can be solved by uninstalling all prior rails and active* beta versions using the gem command:

gem uninstall railties actionpack actionmailer activemodel activeresource activerecord activesupport
Then reinstall […]

Rails3 - Beta - No such file or directory - lib

Tuesday, den 27. April 2010

If you encounter an error like the following when trying to install rails 3 prerelease:

ravel:~ jfischer$ gem install rails –prerelease

Successfully installed rails-3.0.0.beta3

1 gem installed

Installing ri documentation for rails-3.0.0.beta3…

ERROR:  While executing gem … (Errno::ENOENT)

No such file or directory - lib
then you might want to try skipping the ri and rdoc generation which worked for me:

ravel:~ jfischer$ […]

Scottish Ruby Conference 2010 sum up

Thursday, den 8. April 2010

Really impressed by the beauty of scottish architecture I was wondering how the Scottish Ruby Conference will be like.It has been held at the Royal College of Physicians in Edinburgh a really impressive location. With a history of more than 300 (!) years it is an organization contrasting the the baby aged computer science fraction.
The contrast of talks delivering […]

Ruby en Rails 2009 Conference in Amsterdam

Tuesday, den 3. November 2009

This year’s Ruby en Rails conference in Amsterdam was a great success. A lot of great speakers came together with an amazing audience.
Besides the two Rails talks from Jeremy Kemper and  Yehuda Katz there were a lot of really interesting talks.
Jonathan Weiss’ Talk about Rails Security, for instance, was very interesting and should be a […]

RTeX::Document::GenerationError with Phusion Passenger

Thursday, den 17. September 2009

In a recent project I experienced a RTeX::Document::GenerationError only when using Phusion Passenger. After a closer look I’ve seen that the PDF has been successfully created but the redirect to the following request failed. Everything works fine with mongrel.
However, the error messaged looked like the following:
RTeX::Document::GenerationError in BillsController#index</h3> […]

MacOS X - Rails - RTex - Latex Installieren - Unicode - ucs.sty

Saturday, den 15. August 2009

In order to create PDFs with unicode (utf8) support within a Ruby on Rails app on Mac OS X, you need a fully working Latex installation including the ucs.sty extension.
The best way to install Latex on a Mac OS X is using MacPorts. The following command will install Tex, Latex and a whole bunch of […]

Ruby (on Rails) - Wirble - Pimp my IRB and Console

Monday, den 20. July 2009

Ever wanted a colored irb or script/console? Well, you should try wirble. It gives you a number of enhancements for Irb.
Some of the features are:

Tab completion
Colorized results

Installation is easy as pie:
 sudo gem install wirble

vi .irbrc
require ‘rubygems’
require ‘wirble’
# start wirble (with color)
Wirble.init
Wirble.colorize

Ruby on Rails 2.3 - Nested Attributes with AJAX support

Sunday, den 12. July 2009

Introduced in Rails 2.3 nested attributes help to shorten code if you want to
edit multiple nested models within a single form.
Here the corresponding article from the rails weblog:
http://weblog.rubyonrails.org/2009/1/26/nested-model-forms
There is also a very good tutorial on nested forms from Ryan Daigle:
http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes
Right now it seems as if there is no clean way to have ajax enabled nested […]

Rails 2.3 - Test Unit - undefined method `fixtures’ (NoMethodError) - undefined method `fixtures’

Thursday, den 9. July 2009

After switching to Rails 2.3 you might receive the following error messages while executing your TestUnit tests:
undefined method `fixtures’ (NoMethodError)
and/org
undefined method `fixtures’
The solution to this is to change the class in
test/test_helper.rb
from Test::Unit::TestCase to ActiveRecord::TestCase.
You will need to apply this change to all Tests inheriting for the  Test::Unit::TestCase class.