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

Can’t migrate database after scaffold. Section 2.2 Ruby on Rails Tutorial Michael Hartl

I just ran into this as well. This is due to ActiveRecord 4.2.0.beta4 passing a parameter to Arel::Nodes::BindParam.new. Arel 6.0.0 was just released today. In this version, BindParam does not accept any parameters in it’s initalizer. ActiveRecord has already fixed this on the master branch. Until beta5 is released you’ll need to lock your Gemfile … Read more