Kiasyn's Blog

14Aug/100

RVM, Merb, Rake and RSpec

I was having terrible difficulty getting Merb to work with RSpec. Turns out that Merb now uses Bundler, and if you don't edit your Gemfile to include rspec it bails on you.

  sam@shiny-dev:~/Projects/mojo$ rake db:migrate
    (in /home/sam/Projects/mojo)
    Merb root at: /home/sam/Projects/mojo
    /home/sam/.rvm/gems/ruby-1.9.1-p378@merb/gems/dm-validations-1.0.0/lib/dm-validations.rb:33: warning: already initialized constant OrderedHash
    Loading init file from ./config/init.rb
    Loading ./config/environments/development.rb
    rake aborted!
    no such file to load -- spec/rake/spectask
    /home/sam/Projects/mojo/Rakefile:24:in `require'
    (See full trace by running task with --trace)

This was solved by adding the line:

gem "rspec", :require => "spec"

to the bottom of the Gemfile in the project root.

Filed under: Uncategorized No Comments