NoMethodError: private method `open’ called for Gem::Package:Class An error occurred while installing rake (10.0.3), and Bundler cannot continue
You should first update Rubygems: gem update –system And then update Bundler: gem install bundler
You should first update Rubygems: gem update –system And then update Bundler: gem install bundler
Typically your Rakefile will have something like this: task :default => [:spec] You just need to add more tasks into this list.
$ rake middleware use ActionDispatch::Static use Rack::Lock use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd148f9468> use Rack::Runtime use Rack::MethodOverride use ActionDispatch::RequestId use Rails::Rack::Logger use ActionDispatch::ShowExceptions use ActionDispatch::DebugExceptions use ActionDispatch::RemoteIp use ActionDispatch::Reloader use ActionDispatch::Callbacks use ActiveRecord::Migration::CheckPending use ActiveRecord::ConnectionAdapters::ConnectionManagement use ActiveRecord::QueryCache use ActionDispatch::Cookies use ActionDispatch::Session::CookieStore use ActionDispatch::Flash use ActionDispatch::ParamsParser use Rack::Head use Rack::ConditionalGet use Rack::ETag run RackTest::Application.routes http://pothibo.com/2013/11/ruby-on-rails-inside-actiondispatch-and-rack/
As of version 0.10.0 rubocop contain a custom rake task that you can use. Just put the following in your Rakefile require ‘rubocop/rake_task’ RuboCop::RakeTask.new Make sure to use upper-case ‘R’ and ‘C’ or you will get a NameError.
You can use args.extras to iterate over all the arguments without explicitly stating how many parameters you have. Example: desc “Bring it on, parameters!” task :infinite_parameters do |task, args| puts args.extras.count args.extras.each do |params| puts params end end To run: rake infinite_parameters[‘The’,’World’,’Is’,’Just’,’Awesome’,’Boomdeyada’] Output: 6 The World Is Just Awesome Boomdeyada
Actually, automation is useful to Python developers too! Invoke is probably the closest tool to what you have in mind, for automation of common repetitive Python tasks: https://github.com/pyinvoke/invoke With invoke, you can create a tasks.py like this one (borrowed from the invoke docs) from invoke import run, task @task def clean(docs=False, bytecode=False, extra=””): patterns = … Read more
Use Rake::TestTask http://rake.rubyforge.org/classes/Rake/TestTask.html . Put this into your Rake file and then run rake test: require ‘rake/testtask’ Rake::TestTask.new do |t| t.libs << “test” t.test_files = FileList[‘test/test*.rb’] t.verbose = true end
Rake arguments are painful to pass around, unfortunately (and db:seed doesn’t pass its arguments through, regardless). Your best bet is to use environment variables to pass your extra args through: rake db:seed minimal=yes and unless ENV[“minimal”] # do stuff etc
You can either put your tasks into rakelib/ folder which rake loads by default or add a specific folder in your Rakefile via: Rake.add_rakelib ‘lib/tasks’
It will run the down and then the up step (This command can drop your table!): rake db:migrate:redo VERSION=xxxxxxx To prevent your table from being deleted you could do this in conjunction with commenting out the down step temporarily.