Questions tagged [rake]

1

votes
1

answer
256

Views

Rails 4: PG::InFailedSqlTransaction when testing a rake task with RSpec

I am currently trying to test a rake task with RSpec. My Rails version is 4.2.4 and rspec-rails version is 3.3.2. I've have the following in rails_helper.rb: ENV['RAILS_ENV'] ||= 'test' require 'spec_helper' require File.expand_path('../../config/environment', __FILE__) require 'rspec/rails' require...
DaniG2k
1

votes
0

answer
99

Views

Heroku: Long running Rake task eventually crashes

I have a rake task I'm going to use only once, to import a massive CSV file. heroku run:detached bundle exec rake owners:import The rake task works ok locally. It runs for > 8 hours on Heroku, but eventually crashes. The task is not completed. Checking processes: heroku ps === web (Standard-...
Will
1

votes
1

answer
198

Views

Heroku run rake db:migrate aborted

so I'm creating a ruby on rails app and I can't deploy in Heroku because I can't do the heroku run rake db:migrate. In localhost the app works well it just fails when I try to deploy it in Heroku. It aborts and says the following: $ heroku run rake db:migrate Running rake db:migrate on ⬢ tranquil...
Alexandre Salsinha
1

votes
0

answer
59

Views

CodeShip: Cannot load such file — 'sinatra/base'

I was trying to run my tests through CodeShip and somehow it doesn't allow me to setup my test environment. My config scripts are: rvm use 2.4 --install bundle install rake db:create RACK_ENV=test rake db:migrate RACK_ENV=test rake db:seed RACK_ENV=test My test script is simply rake test My Rakefile...
yzhan
1

votes
0

answer
99

Views

How can I generate several output formats from one RuboCop::RakeTask using “formatters”?

For integrating our Rubocop reports into Jenkins, I'd like to generate both Checkstyles -- XML output and HTML output -- in one go. I can achieve this when running Rubocop directly: $ rubocop -r rubocop/formatter/checkstyle_formatter \ --format html --out reports/html/index.html \ --format RuboCop::...
Frank Schmitt
1

votes
1

answer
1.4k

Views

Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound) - Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS

I am using the Bitnami Redmine Stack 3.3.1-0 on Ubuntu 16.04.2 LTS. I recently installed a plugin (Issue Templates - http://www.redmine.org/plugins/redmine_issue_templates). In the process, I updated the gems using bundle install and bundle update. After performing this update, the Redmine websi...
User 392017
1

votes
1

answer
24

Views

rake: Lost rule-dependency when defining another dependency

I have a problem with a rule in combination with other file dependencies. See the following minimal example: require 'rake' rule '.tex' do |tsk| puts 'Create %s' % tsk.name end rule '.pdf' => '.tex' do |tsk| puts 'Create %s' % tsk.name end #~ file 'test.pdf' => 'include.tex' task :default => 'test....
knut
1

votes
0

answer
115

Views

How to invoke migration in rake task in Rails5

In Rails 5, I am no longer able to use a rake task that migrates files in a different directory. I get the error ActiveRecord::UnknownMigrationVersionError: No migration with version number 20180209214145. Any idea how I could do this in Rails 5? I think that the line ActiveRecord::Migrator.migrat...
Julie
1

votes
1

answer
95

Views

rake db:migrate returning error rake db:migrate

I am getting an error while running rake db:migrate on windows failed to execute: pg_dump -s -x -O -f F:/Installer/humboldt-master/humboldt-master/db/structure.sq l --schema=public --schema=postgis --schema=topology humboldt_dev Please check the output above for any errors and make sure that pg_dump...
Sumit Sharma
1

votes
0

answer
101

Views

How to properly run multiple tasks using one worker in heroku and ruby on rails

I'm trying to run many (over 20) tasks in Heroku every minute simultaneously, but I'm pretty sure I'm not doing it correctly. I'm currently using the Standard-1X dynos with 512 MB RAM. I'm pretty sure I should be able to achieve my goal without having to upgrade heroku. My solution kind of works, bu...
apuente
1

votes
2

answer
48

Views

Local rake tasks require development gems to be in production group

I have some rake tasks that I only perform locally. However since I refer to the some gem classes in rake tasks, this seems to require that the gem be installed and loaded on the production server. Among other things this increases deploy time and memory usage on the server. This may or may not have...
pixelearth
1

votes
2

answer
219

Views

Unable to run migration scripts

I've been creating an app using Ruby on Rails on Windows for almost two years and I've had it. This weekend I started migrating my dev environment over to Ubuntu because it can run some tools/services not available in Windows. I tried to run a migration and I got this error msg: $ bundle exec rake d...
goterpsgo
1

votes
1

answer
66

Views

ActiveRecord or Postgresql Setting Wrong ID When Creating New Record

I am Rails 5.1 with Postgresql 9.6.9 on Heroku free tier. I recently was using a rake task with csv files to try to create a couple of batches or records. I then wanted to test the front end use and just verify my forms were working like they do in development. However, when I went to add a new Rec...
N. Robbert
1

votes
1

answer
73

Views

Rake task to send emails. Do i need a queue?

I have setup crontab with whenever gem to send emails at time. Cron just calls the rake task, which gather all emails and sends them in loop. My question is do I need some queue system that provide me assurance that code won't crash ? I mean when I gather 1000 emails and I will be sending them in lo...
sonic
1

votes
0

answer
23

Views

How to run subtasks multiple times in rake multitask?

So I have multitask :do_something => [ :task1, :task2, :task3, :task4, :task5, :task6 ] And each task runs a script. I want the tasks1 to task6 concurrently to run 1000 times without stopping. Is there a way it can be achieved?
Swamp Dragon
1

votes
1

answer
25

Views

DigitalOcean - cap staging deploy error on precompiling assets

When I run cap staging deploy:check it succeeds. When I run cap staging deploy it succeeds until deploy:assets:precompile at which I get this error: 01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile 01 rake aborted! 01 ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relatio...
Josiah Palmer
1

votes
0

answer
30

Views

NLS_LANG = 'AMERICAN_AMERICA.UTF8 issue with Ruby rake

I am using ruby 2.5 and supporting for foreign chars I am using.. NLS_LANG'] ||= 'AMERICAN_AMERICA.UTF8 In ROR application. But facing issue with special chars in file name. Here is the Problem statement. Generating the files using ruby rake Files are getting generated on Linux server Files are h...
Sudhir
1

votes
0

answer
26

Views

How to convert mongodb data encrypted with Gibberish to RbNaCl

I took over a ROR/MongoDB project that is using Gibberish w/ Mongoid::EncryptedFields Gibberish is outdated and not supported anymore. The entire database data is encrypted with Gibberish using something like the following. Mongoid::EncryptedFields.cipher_same_salt = GibberishCipher1.new(ENV['MONGOD...
jdog
1

votes
2

answer
38

Views

rails migration apparently causing infinite forking

I've encountered a problem today that I've so far not had any luck tracking down. I created a new migration file (via 'rails g migrate ...'). After creating the file, when I run rails db:migrate or rails db:migrate:status, the result is that rails appears to be infinitely starting itself - i.e., f...
jtc
1

votes
0

answer
53

Views

Get name of original rake task or pass argument

I have a script which I want to call via a rake task like this: task init_general: %i[call_step validate_step init] task init_sub: %i[call_step validate_step init] If you can see, it is somehow the same. But in the init script, there is a small code piece which should only be executed if init_genera...
FrostX
1

votes
0

answer
21

Views

Using Reveal.js as Asciidoctor backen when using Rake

I would like to create some slides with the help of Asciidoctor Reveal.js an thought it would be adequate to build my slides with Rake. But I am to s****d to set Reveal.js as backend for Asciidoctor. require 'asciidoctor' task default: %w[html5] MASTER_FILENAME='slides.adoc' OUTPUT_FILENAME='index.h...
Oliver
1

votes
2

answer
404

Views

Vary the command/pathmap run in a rake rule based on which target is running

I'm trying to write a Rakefile that both builds my code normally when I run rake compile but puts the targets in a different directory and builds with -DTEST when I run rake test. I cannot for the life of me figure out how to do it, though. I've got something like this at the moment: SRC = FileLis...
womble
1

votes
1

answer
125

Views

Why is Rake running a model for which I can find no test?

When I run 'rake', it's loading up one of the models among all of the classes I have in my app/models directory. The thing is, it's not one I have a test for, it's just a model I have in there that is actually used with script/runner to run in the background and perform tasks for my main Rails appli...
John Munsch
1

votes
1

answer
257

Views

How do I code a rake task to trigger a BackgrounDRb task?

I have a BackgrounDRb worker set up to run its 'sync' method every 15 minutes. Then, say, I want to run the method once just now. I was trying to wrap that in a rake task as follows: namespace :mytasks do task :sync do |t| worker = MiddleMan.worker(:my_worker) worker.async_sync end end But this does...
eploko
1

votes
2

answer
2k

Views

Data Driven Testing with Ruby's Test::Unit for Selenium

I'm pretty new to both Ruby and Selenium and I'm just trying to figure out the best way to build my test harness. I'm using Rake, Rake::TestTask, and Test::Unit to power this. I have a suite that I'd like to run once for each browser/os combination. I can't figure out how to parameterize my tests th...
Trey
1

votes
4

answer
421

Views

Oracle problems in Rails with rake, but not with site

I'm working on a Rails site that connects to an Oracle database, and though I didn't build the site from scratch, I'm doing maintenance work. The site uses the delayed_jobs plugin to handle some background tasks and I'd like to be able to run rake jobs:work on the development server to periodically...
justinbach
1

votes
1

answer
758

Views

Why does Rake crash my Mac OS X ?

I'm running Mac OS X 10.6.2 and I've got a strange problem with rake and my ruby applications. Has soon as I launch a rake command my mac crashes and ask me to reboot (dark screen). This occur when I try to run a Rakefile or even simply if I type: rake --version I tried reinstalling rake by running...
XPac27
1

votes
1

answer
226

Views

Best way to handle multiple configuration matrix with rake?

I have an application that can be built in one of 2 configurations (Company1 or Company2) and in debug or release mode. Company1 Release All builds done with the Release compiler flag Build and output core dll files to build directory Build and output Company1Plugin.dll to build directory Copy tools...
George Mauer
1

votes
1

answer
146

Views

Interactive task scheduler recommendations?

Hey folks, I am looking for something to manage and schedule the execution of rake tasks, like database backups or running reports; something that has a nice web interface so I don't have to use cron. I'm looking at hudson, but it seems this is more geared toward CI builds. Rather than roll my own,...
smnirven
1

votes
1

answer
472

Views

rake test and test_structure.sql

First of all, I have to run 'rake RAILS_ENV=test ...' to get the test suites to hit my test DB. Annoying but ok to live with. However when I do so, I get a long stream of errors like so: > rake RAILS_ENV=test -I test test:units psql:/path/to/project/db/test_structure.sql:33: ERROR: function 'armor'...
korinthe
1

votes
1

answer
342

Views

Is it possible to run a SQL-only file from a “rake db:create”?

I'm trying to install a software called Teambox in my Dreamhost shared account, following these instructions. I have no experience with Rails. I just want to install the software in the shared hosting. In this shared hosting, all dependencies are ok, but I have to create the dabatase from their pane...
1

votes
1

answer
372

Views

Using Routing helpers in a Rake task

I have a rake task that sends out the next 'x' invitations to join a beta it uses this code: desc 'This will send out the next batch of invites for the beta' task :send_invites => :environment do limit = ENV['limit'] c = 0 invitation = Invitation.all(:conditions => { :sent_at => nil, :sender_id => n...
trobrock
1

votes
1

answer
1.2k

Views

Is there a way to programmatically count RSpec tests?

Given a Rakefile that executes some RSpec tests by way of a Spec::Rake::SpecTask, how can I programmatically determine the number of tests that passed, failed, and are pending once the task that ran the tests is finished?
John Feminella
1

votes
1

answer
171

Views

Rails “rake test” crashing

this might be rather unspecific, but I'm trying to do 'rake test' on a new rails app, and end up with (in /Users/myname/dev/railstest/RailsApplication1) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I'lib:test' '/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader....
Jörg Haubrichs
1

votes
1

answer
907

Views

Using WAMP's MySQL with Cygwin Ruby on Rails

I'm trying to install a Rails app on a Cygwin Rails + WAMP MySQL setup, but rake trows an error : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Of course, it's trying to connect to MySQL trought a Cygwin socket, and since there's no MySQL server running on Cygwin, it fails...
Andrei
1

votes
1

answer
691

Views

How to call ActiveSupport method inside rake task?

This is what I'm trying: require 'active_support' desc 'test' task :foo => [:environment] do parse(:categories) do |hash| # cleanup name hash[:name] = titlecase(hash[:name]) # ... end end This is the error I'm getting: undefined method `titlecase' main:Object I've also tried: ActiveSupport::Inflecto...
maček
1

votes
1

answer
606

Views

Rails3 mysql2 rake error

i'm running ruby 1.8.7 with rails3. after installing mysql2 (successful) I want to create the dbs, but the following error occurs: noname:addressDB clemens$ rake db:create (in /.../addressDB) rake aborted! undefined method `errno' for # (See full trace by running task with --trace) noname:addressDB...
Tronic
1

votes
1

answer
262

Views

Rails Unit Test Issue with rake

I am working on writing tests for a rails 2.3.4 application and I am running into the following error when I try to run the tests 1) Failure: default_test(ReportTest) [rake (0.8.7) lib/rake/rake_test_loader.rb:5]: No tests were specified. This is what the only test file looks like: require File.dirn...
Jimmy
1

votes
1

answer
841

Views

Why am I getting a NoMethodError for an attribute that exists in my model?

This is the error I get: ContactPostalcardsController#skip (NoMethodError) 'undefined method `status=' for #' This is the code calling it and trying to assign a value to the status attribute for ContactPostalcard (the Model): def skip @contact_postalcard = ContactPostalcard.new(params[:contact_posta...
Angela
1

votes
1

answer
677

Views

Simulate ant copy in rake

I want to copy some files with Rake, but compared to Ant this is kind of clumsy and my implementation is a bit stupid. The source files have read only flags, I wish to copy files with write access (ant did this automatically). If the target is not newer than the source, then I don't want to copy. He...
Drew

View additional questions