rake

Continue Rake after failure

扶醉桌前 提交于 2019-12-07 04:10:14
问题 I'm running rake to automate my build process inside of CCNet. I use it to start IIS Express, then run Nunit, and then shutdown the server after Nunit has finished. The problem is that every time Nunit fails, the rake stops, and never gets to the shutdown part. How do I continue a rake after Nunit has failed, and still tell CCNet that Nunit has failed, and thus so has the build? 回答1: How do you run NUnit from rake? are you using "sh"? This is how you use "sh" to execute shell command, and

Odd rake db:migrate output

独自空忆成欢 提交于 2019-12-07 03:52:23
问题 Why does rake db:migrate run Execute db:schema:dump my output is all screwed up (showing SQL). Looks like this: ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" (3.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete FROM pg_constraint c JOIN pg_class t1 ON c.conrelid = t1.oid JOIN pg_class t2 ON c.confrelid = t2.oid JOIN pg

rake db:migrate doesn't work after ruby 2.2.2 to 2.2.3 upgrade via RVM

安稳与你 提交于 2019-12-07 02:44:33
问题 I recently upgraded from Ruby 2.2.2 to 2.2.3 using RVM. This messed up some things in my development environment but I could handle it so far thanks to useful error messages. Now I wanted to add some migrations to my DB and encountered this error: $ rake db:migrate /Users/howard/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval': /Users/howard/.rvm/rubies/ruby-2.2.3/bin/rake:4: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError) exec "$bindir/ruby"

Rails 3.1: how to run an initializer only for the web app (rails server/unicorn/etc)

a 夏天 提交于 2019-12-07 00:57:17
问题 My webapp needs to encrypt its session data. What I setup is: config/initializers/encryptor.rb: require 'openssl' require 'myapp/encryptor' MyApp::Encryptor.config[ :random_key ] = OpenSSL::Random.random_bytes( 128 ) Session.delete_all app/models/session.rb: require 'attr_encrypted' class Session < ActiveRecord::Base attr_accessible :session_id, :data attr_encryptor :data, :key => proc { MyApp::Encryptor.config[ :random_key ] }, :marshal => true # Rest of model stuff end That all works great,

Database not being selected in rails project when attempting to rake db:migrate

痞子三分冷 提交于 2019-12-06 23:47:16
问题 Working with a rails app, having some manner of weird database / rake issues. When I execute: rake db:migrate I am getting the following error: Mysql2::Error: No database selected: SHOW TABLES (See full trace by running task with --trace) The trace isn't revealing much useful information. Can be seen here: http://pastebin.com/WdsguudC The config file looks right, and the user is getting logged in, or I would have gotten some kind of access error. The database exists, the user has correct

Can spork work with rake tasks?

℡╲_俬逩灬. 提交于 2019-12-06 20:46:05
问题 Rake tasks suffer from the same problem as running tests: the Rails bootup process takes a long time before the task is even running. Is there a way to integrate spork and rake together? 回答1: You can use the irake gem which makes it possible to execute rake tasks from the console. Add this to Gemfile: gem 'irake' Then bundle and start console $ bundle install $ rails console ...and wait for the Rails environment to load (only once). Then you can do: rake "db:migrate" If you want to list tasks

Rails 3 > Rendering views in rake task

蹲街弑〆低调 提交于 2019-12-06 19:54:47
问题 I'm stuck with a rake task that need to prepare a newsletter for Mailchimp. Using rails 2.x stuff googled I now have this code: desc "Sends newsletter to Mailchimp list" task :send_newsletter => :environment do begin # get render helpers av = ActionView::Base.new(Rails::Application::Configuration.new(Rails.root).view_path) av.class_eval do include ApplicationHelper end things = Stuff.do.things h = Hominid::Base.new({:api_key => "xxx"}) h.create_campaign( { :list_id => "xxx", :subject => "Hey.

LoadError: cannot load such file — rspec/core/rake_task

自闭症网瘾萝莉.ら 提交于 2019-12-06 19:20:59
问题 Update: this issue is still not solved! Any help is appreciated! 05/07/2015 Update: a workaround is found. Please see my own answer 05/09/2015 When I rake, I got this error. AllenLins-MacBook-Pro:geoblacklight allenlin$ rake -t Resolving dependencies... You must `gem install bundler` and `bundle install` to run rake tasks rake aborted! LoadError: cannot load such file -- rspec/core/rake_task /Users/allenlin/Documents/USpatial/geoblacklight/Rakefile:12:in `require' /Users/allenlin/Documents

Rake and Uninitialized Constants

青春壹個敷衍的年華 提交于 2019-12-06 15:39:33
I have spent hours upon days trying to resolve this. Rake is throwing the following error: dcarpenter$ rake rake aborted! uninitialized constant ActionView::Helpers::JavaScriptProxy I can't seem to find anyone who has had this issue on Google, this site or elsewhere. What steps should I take to resolve this and what do I need to know? rake --trace yields: /Users/dcarpenter/Dropbox/workspace/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in `const_missing' /Users/dcarpenter/Dropbox/workspace/gems/jrails-0.6.0/lib/jrails.rb:231:in `<module:Helpers>' /Users/dcarpenter/Dropbox/workspace/gems/jrails-0.6

Recursive wildcards in Rake?

允我心安 提交于 2019-12-06 15:38:56
Follow up to this question about GNU make : I've got a directory, flac , containing .FLAC files. I've got a corresponding directory, mp3 containing MP3 files. If a FLAC file is newer than the corresponding MP3 file (or the corresponding MP3 file doesn't exist), then I want to run a bunch of commands to convert the FLAC file to an MP3 file, and copy the tags across. The kicker: I need to search the flac directory recursively, and create corresponding subdirectories in the mp3 directory. The directories and files can have spaces in the names, and are named in UTF-8. It turns out that this won't