rake

How to make rake test not use the default minitest?

主宰稳场 提交于 2019-12-12 17:03:42
问题 I am following along the Make your own Gem Guide from RubyGems. Executing the rake test instructions fails as follows: > rake test ~/.rbenv/versions/2.1.2/lib/ruby/2.1.0/minitest/unit.rb:26:in `const_missing': uninitialized constant MiniTest::Test (NameError) <rest of output truncated> I figured that it is because the minitest version being used is 4.7.5 and not 5.6.0 (or any of the 5.0.0 series that is needed to have MiniTest::Test be valid). So I installed minitest 5.6.0 and now I have both

How to move your rake tasks to the rails lib dir from in a gem generator?

限于喜欢 提交于 2019-12-12 16:18:42
问题 Im creating a custom gem and have some rake files that need to be installed into the users /lib/tasks directory to work. I want create a generator that will move / create my rake tasks in the tasks directory so they can use them. Does anyone have any idea how do to this in a custom gem? 回答1: Ensure that your gemspec includes the tasks and then in your Rakefile require 'bundler' Bundler::GemHelper.install_tasks 回答2: You just need require your rake file in your Rakefile of your root project. 来源

Why is my rake call causing an 'undefined method `source_index`' error?

江枫思渺然 提交于 2019-12-12 13:49:54
问题 I am trying to run bundle exec rake db:migrate then encountered the following error. bundle exec rake db:migrate --trace ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! undefined method `source_index' for Gem:Module C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.17/lib/initializer.rb:298:in `add_gem_load_paths' C:/Ruby193/lib/ruby

Ruby on Rails Rake Error

霸气de小男生 提交于 2019-12-12 10:47:20
问题 EDIT: Solved the problem, thanks to this forum post: http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407. Thanks everyone! I've started learning RoR and have been trying to use rake db:migrate but I keep getting the same error. I can connect to the MySQL database using C:\dev\railslist>mysql -u root railslist_development -p . rake db:migrate --trace produces the following: C:\dev\railslist>rake db:migrate --trace (in C:/dev/railslist) ** Invoke db:migrate

Execute a rake task on a remote server

怎甘沉沦 提交于 2019-12-12 10:44:06
问题 The physical architecture of the production environment includes several machines doing different jobs (rake tasks), all of them over the same database. One of the jobs would do a large UPDATE over a table that usually returns a postgres deadlock if the other jobs are running. I already have a rake task to gracefully stop the other jobs, but I can only execute it from the local machines. What I want to achieve is: task :big_update => :environment do stop_tasks_on_another_servers # do the SQL

rails s: Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)

风格不统一 提交于 2019-12-12 09:29:19
问题 When I start rails with: $ rails s I get: /Users/snowcrash/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound) So, I ran bundle install : $ bundle install Using rake 10.4.2 but gem list rake gives: *** LOCAL GEMS *** rake (10.1.0, 10.0.4) How come I don't have rake 10.4.2 installed? Also, when I run bundle check it gives me: The Gemfile's dependencies are satisfied which

Is it possible to enhance the rake test task and merge test results together?

妖精的绣舞 提交于 2019-12-12 09:22:51
问题 I am writing tests for my sidekiq workers and I want them to run when I type "rake" in the terminal. I have that working - I added the following to my Rakefile: namespace :test do Rake::TestTask.new(:workers) do |t| t.libs << "test" t.pattern = 'test/workers/**/*_test.rb' end end Rake::Task[:test].enhance ["test:workers"] When I run rake I get something like this as my output: Run options: --seed 51172 # Running tests: SS Finished tests in 0.005594s, 357.5259 tests/s, 0.0000 assertions/s. 2

How to use input filename to generate output filename with Rake?

人走茶凉 提交于 2019-12-12 09:08:31
问题 I've got some input files which I want to encode using Ruby. The output from the encoding should match some pattern based on the filename of the input file. In order to not do this by hand, I want to use Rake as help for automation. Further I'd like to not specify a single task for every input file. I've tried some FileList "magic" but it didn't work out. Here's the code: desc 'Create all output from specified input' task :encode do FileList['input/*.txt'].each {|input| file "output/output_#

How to set up a Rake task for seeding

不羁的心 提交于 2019-12-12 08:54:57
问题 (This is really a newbie question about Rake & Rails & dependencies in general. Trying to wrap my head around how all this fits together) Basically, I want a Rake task that acts like seed.rb but is called separately. It adds test data for the development environment, while my seed.rb provides basic data for all environments. The script, family_seed.rb, uses FactoryGirl to generate some records. It looks like this: require File.expand_path('../../config/environment', __FILE__) require './spec

Can't run any rake command: “ERROR: 'rake/rdoctask' is obsolete and no longer supported” [closed]

主宰稳场 提交于 2019-12-12 08:23:30
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm trying to run the rake migrate:db command and I get the following error message: ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead. I tried doing