NoMethodError: undefined method `last_comment’ after upgrading to rake 11

Rake 11.0.1 removes the last_comment method which Rails 2.3 rspec-core (< 3.4.4) uses. Therefore until/if a patch is released we need to pin rake to an older version in Gemfile: gem ‘rake’, ‘< 11.0’ then: $ bundle update $ grep rake Gemfile.lock rake rake (>= 0.8.7) rake (10.5.0) rake rake (< 11.0) We are now … Read more

How to run a single test from a Rails test suite?

NOTE: This doesn’t run the test via rake. So any code you have in Rakefile will NOT get executed. To run a single test, use the following command from your rails project’s main directory: ruby -I test test/unit/my_model_test.rb -n test_name This runs a single test named “name”, defined in the MyModelTest class in the specified … Read more

How to pass arguments into a Rake task with environment in Rails? [duplicate]

Just to follow up on this old topic; here’s what I think a current Rakefile (since a long ago) should do there. It’s an upgraded and bugfixed version of the current winning answer (hgimenez): desc “Testing environment and variables” task :hello, [:message] => :environment do |t, args| args.with_defaults(:message => “Thanks for logging on”) puts “Hello … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)