rake

How can I stop Heroku Dyno that is running a Rails task through Heroku Scheduler?

最后都变了- 提交于 2019-12-08 19:22:59
问题 Heroku Scheduler uses a One-off Dyno to run the scheduled task. That dyno doesn't appear in Heroku Dashboard, but it's there. How can I restart it, or temporarily stop it? 回答1: If you have the command line tools installed, heroku ps will list all the running processes, and you can use ps:kill or ps:restart to manage any of them. heroku help ps will give you more details. 回答2: You do not need to restart or stop. There are no dynos on Heroku dashboard, but you can find your scheduler in Heroku

How do I use a custom log for my rake tasks in Ruby on Rails?

二次信任 提交于 2019-12-08 17:27:40
I have a rake task that calls functions like this: namespace :blah do task :hello_world => :environment do logger.info("Hello World") helloworld2 end end def helloworld2 logger.info("Hello Again, World") end I want the log output to a custom log, and I really don't want to have to pass a log reference every time I make a function call. I found this somewhere (can't find it again): def logger @@logger ||= Logger.new("#{RAILS_HOME}/log/blah.log") end But this does not work for me and I am not sure what it even does because I grabbed the code a long time ago and haven't used it until now. I can't

Should I use “rake spec” or “rspec” (can't get “rake spec” to work)?

允我心安 提交于 2019-12-08 15:09:08
问题 I am on Rails 3.2 and I am using rspec (2.11.1). When I run my test suite with "rake spec" I get failures. When I run it with "rspec" everything passes. I've seen other mentions of this problem but nothing definitive that explains what is going on and what best practices are. If I do "rake spec" or "rake tmp:clear && rake spec" my tests fail. If I do "rspec" or "rspec spec" or "rake db:test:prepare && rspec" my tests pass. I thought the only difference was that rake did "db:test:prepare" but

Could not find mime-types-1.23 in any of the sources

懵懂的女人 提交于 2019-12-08 11:51:59
问题 When I run the command bundle exec rake db:migrate , I get the error: Could not find mime-types-1.23 in any of the sources Then I run: gem list among the output there is: mail (2.5.4) **mime-types (1.23)** mini_portile (0.5.0) minitest (4.3.2) multi_json (1.7.7) nokogiri (1.6.0) What can be done? 来源: https://stackoverflow.com/questions/17422925/could-not-find-mime-types-1-23-in-any-of-the-sources

How to quickly initialize ruby project development environment?

与世无争的帅哥 提交于 2019-12-08 09:39:27
问题 How to specify gem dependencies in a way that user with only ruby, rake and rubygems installed could issue a single rake command to install all the dependencies required? Is it possible to use the same dependency specification when building gem with GemBuildTask? 回答1: It's actually pretty easy to set up a rake task that installs a bunch of gems: task :install_gems do require "rubygems" require "rubygems/dependency_installer" installer = Gem::DependencyInstaller.new [["rack"], ["merb-core", "1

What does this rake db:seed error mean?

a 夏天 提交于 2019-12-08 08:17:02
问题 I've been trying to solve this problem for a couple of hours but I can't seem to understand what's going on. I'm using Rails 3 beta, and want to seed some data to the database. However, when I try to seed some values through db:seed, I get this error: rake aborted! Attribute(#81402440) expected, got Array(#69024170) The seeds.rb is: DataType.delete_all DataType.create( :name => 'String' ) And I got these classes: class DataType < ActiveRecord::Base has_many :attributes end class Attribute <

Rails 3.1/rake - datespecific tasks without queues

时光怂恿深爱的人放手 提交于 2019-12-08 06:38:14
问题 I want to give my users the option to send them a daily summary of their account statistics at a specific (user given) time .... Lets say following model: class DailySummery << ActiveRecord::Base # attributes: # send_at # => 10:00 (hour) # last_sent_at # => Time of the last sent summary end Is there now a best practice how to send this account summaries via email to the specific time? At the moment I have a infinite rake task running which checks permanently if emails are available for

Recursive wildcards in Rake?

徘徊边缘 提交于 2019-12-08 05:48:49
问题 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

Capistrano error with successfully copied files

此生再无相见时 提交于 2019-12-08 05:14:05
问题 I'm using Capistrano to deploy an application that uses the theme_support plugin, and I added a method in my deployment recipe to automatically generate the theme cache during a deploy. When I deploy the application the theme files are copied/cached correctly, but Capistrano reports an error: ... *** [err :: servername] cp -r /var/www/app/releases/20110218172542/themes/17/images /var/www/app/releases/20110218172542/public/themes/17/images *** [err :: servername] cp -r /var/www/app/releases

Rails: Help with rake aborted error!

大兔子大兔子 提交于 2019-12-08 04:35:21
问题 I have been trying to run the rake db:migrate command but it ain't working. I uninstalled and installed the gem but no luck. I read somewhere the o.9 wasn't stable and that 0.8.7 was ok. I tried it but I got an error also.. For now the error is Fayimora-Femi-Baloguns-MacBook-Pro:sample_app fayimora$ bundle exec rake db:migrate /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /Library/Ruby/Gems/1.8/gems