rake

running fork in delayed job

别等时光非礼了梦想. 提交于 2019-12-24 10:48:53
问题 we use delayed job in our web application and we need multiple delayed jobs workers happening parallelly, but we don't know how many will be needed. solution i currently try is running one worker and calling fork/Process.detach inside the needed task. i was trying to run fork directly in rails application previously but it didnt work too good with passenger. this solution seems to work well. could there be any caveats in production? 回答1: one issue which happened to me today and which anyone

rails3 rake does not run my tests

ε祈祈猫儿з 提交于 2019-12-24 10:37:59
问题 In a fresh R3 app, I seem to be unable to run any tests (there are 2, the canonical functional test for "/" and another unit test I created) See this output: rails_app$ rake test --trace (in /Users/jan/portfolio/rails_app) ** Invoke test (first_time, not_needed) rails_app$ What could be wrong? What is the meaning of first_time, not_needed'? t might have to do with the fact, that I am using Mongoid... 回答1: When I followed the instructions for Mongoid's installation, I replaced require 'rails

heroku rake db:migrate fails

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 09:59:31
问题 I get the following error: [app (master)]$ heroku rake db:migrate rake aborted! undefined method `root' for Heroku::Rails:Module /app/Rakefile:7 (See full trace by running task with --trace) (in /app) I can't figure out how to run trace as suggested by the error ( heroku rake db:migrate --trace gives "Invalid Option --trace"), and I don't believe this is related to the well-known "heroku doesn't use sqlite3" issue. My Rakefile is as follows: require File.expand_path('../config/application', _

Python build error while building selenium webdriver project

感情迁移 提交于 2019-12-24 09:48:35
问题 I'm attempting to get into some opensource projects, and as a QA engineer, have been looking at Appium and Selenium. Situation: Windows 10 Appium: cloned repo, built successfully Selenium: cloned, but having troubles. Installed: Java, JDK, python 3.6, Ruby, Rake gem. Error, I use go + a target, eg 'go build', 'go' or 'go firefox'. However I'm always getting the following error: The error: C:\Users\Mark\selenium>go build (in C:/Users/Mark/selenium) python C:/Users/Mark/selenium/buck-out/crazy

Testing a Rake task that uses OptionParser with RSpec

五迷三道 提交于 2019-12-24 07:29:08
问题 I have a Rake (12.0) task that uses OptionParser to get an argument. The task looks like require 'optparse' namespace :local do task :file do options = Hash.new opts = OptionParser.new opts.on('--file FILE') { |file| options[:file] = file } args = opts.order!(ARGV) {} opts.parse!(args) # Logic goes here. # The following is enough for this question String.new(options[:file]) end end The task can be executed running rake local:file -- --file=/this/is/a/file.ext Now I want to verify with RSpec

Travis CI: The command “bundle exec rake” exited with 1

一个人想着一个人 提交于 2019-12-24 05:34:05
问题 I am having a problem with my Travis build where the build fails with the error The command "bundle exec rake" exited with 1 . Here is the build log from Travis. Here is a link to the GitHub repo. I've tried adding require 'bundler' to my Rakefile as suggested by this question, but that didn't have any effect. I have no problems running bundle exec rake on my local machine and all tests are passing locally. Here is the backtrace from Travis: /home/travis/build/danielbonnell/app/vendor/bundle

Ubuntu 11.04: `apt-get install rake` -> “E: Unable to locate package rake”

时光毁灭记忆、已成空白 提交于 2019-12-24 03:03:48
问题 This is probably a type of "is it plugged in?" question, but after getting a default Rackspace image of Ubuntu 11.04 up. Running command (as root) apt-get install rake Fails with error Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package rake I'm missing something simple I'm sure. 回答1: It appears that rake package is not in the 11.04 sources, but it is in 10.10 sources. To get apt-get install rake to work on 11.04: Add the

rake aborted! ArgumentError: same file:

北城以北 提交于 2019-12-24 02:47:04
问题 When I try to deploy my rails app at cloud66 , I get this error: rake aborted! ArgumentError: same file: /var/deploy/website/web_head/releases/20150315170454/public/assets/tinymce/custom_content.css and /var/deploy/website/web_head/releases/20150315170454/public/assets/tinymce/custom_content.css Tasks: TOP => assets:precompile Can someone please explain why I get this error? how to solve it? 回答1: How are you running your asset pre-compilation? By default, your assets will go to shared/assets

Rake on Rails 3 problem

谁说胖子不能爱 提交于 2019-12-24 01:36:10
问题 I moved a Rails 2.3 application to Rails 3. The application actually works perfectly, but I have issue with rake tasks. It looks like the config in the environment file is not initialized correctly. the error I get is: rake aborted! undefined method `cache_classes=' for #<Hash:0x3c3e850> /var/www/apps/nzar3/config/environments/development.rb:9 ..... The environment file is clean, and it works. Here the environments/development.rb config.cache_classes = false config.whiny_nils = true config

Why does this require fail from rake but succeed when ran explicitly?

与世无争的帅哥 提交于 2019-12-24 00:56:51
问题 Help me understand why this project's tests run when executed directly but do not when run via rake. The error when run via a Rake TestTask: ** Execute test /home/myockey/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -I"lib:test" "/home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/data_test.rb" "test/unit/station_test.rb" "test/unit/raw_test.rb" "test/unit/parser_test.rb" "test/unit/report_test.rb" <internal:lib/rubygems/custom_require>:29:in `require': no