rake

Two errors when using Railroad for Rails

谁说胖子不能爱 提交于 2019-12-13 18:39:24
问题 I've installed the diaspora rails application https://github.com/diaspora/diaspora on my local machine. Then I installed the Railroads diagram generator http://railroad.rubyforge.org/#download Following the instructions on the site, I built a rake task to run it, but appear to be getting two separate errors when I run it. The first error is the absence of the dot command: sh: dot: command not found The second error I also get when running without rake: Seans-MacBook-Pro:diaspora sean$

Change a RDoc template for generating Rails app documentation

南笙酒味 提交于 2019-12-13 18:21:34
问题 I have just added some documentation to my Rails 3.2.13 app. I can generate the documentation just fine (running RDoc 3.12.2) by using a rake task: # lib/tasks/documentation.rake Rake::Task["doc:app"].clear Rake::Task["doc/app"].clear Rake::Task["doc/app/index.html"].clear namespace :doc do RDoc::Task.new('app') do |rdoc| rdoc.rdoc_dir = 'doc/app' rdoc.generator = 'hanna' rdoc.title = 'Stoffi Web App Documentation' rdoc.main = 'doc/Overview' rdoc.options << '--charset' << 'utf-8' rdoc.rdoc

How do I know if a rake task has been invoked from another task or from the shell?

ⅰ亾dé卋堺 提交于 2019-12-13 18:06:52
问题 Let's say we have: task :something => [:something_else] do # some of stuff end task :something_else do # some verbose stuff # some quiet stuff end Now I want something_else to do the verbose stuff when called from the shell ( rake something_else ) and the silent ones when called as a dependency to rake something . 回答1: i think it might be a better idea to work with parameters or different tasks instead. one thing that you could do is look for top-level task like that: task :something_else do

Reset database with rake task

江枫思渺然 提交于 2019-12-13 16:51:29
问题 I want to use Heroku's scheduler to reset my database once every day. It's recommended to use rake tasks for the scheduler. This is what I've tried: task :reset_database => :environment do `heroku pg:reset MY_DB:URL` `heroku run rake db:migrate db:seed` # some other ruby commands end But how would I do this correctly, because putting the heroku commands within backticks, which with bash normally works, doesn't work here: No such file or directory - heroku 回答1: Try this rake task: namespace

Error: “Could not find rake”, yet Rake is installed

你说的曾经没有我的故事 提交于 2019-12-13 16:08:23
问题 Why am I receiving this Rake error: $ rake --version /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError) from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem' from /Volumes/Data

unable to run rake task with smarter_csv

你。 提交于 2019-12-13 07:01:34
问题 I created a rake task for import a csv with smarter_csv gem. Throws the following message, i added the entire error code if it helps: rake import_csv:import_csv Digest::Digest is deprecated; use Digest I, [2017-03-01T11:46:08.551994 #7029] INFO -- : ** [Raven] Raven 0.14.0 configured not to send errors. rake aborted! NoMethodError: undefined method `close' for nil:NilClass /home/my_user/.rvm/gems/ruby-2.1.1@my_app/gems/smarter_csv-1.1.4/lib/smarter_csv/smarter_csv.rb:223:in `ensure in process

Rake Time Zones

一世执手 提交于 2019-12-13 06:24:53
问题 How would I add a new time zone to the list of time zones? If I would have to simply add a time zone to my system, why doesn't it appear on the list: rake time:zones:all As mentioned by ranja below, I tried to use ActiveSupport with time zones. So I open up the console user@host:/var/www/project$ irb irb(main):001:0> require 'active_support' => true irb(main):002:0> But what should I use next? And will the new time zone be lost? How would I implement a permanent new ruby time zone which would

Rails assets precompile mysterious error

一世执手 提交于 2019-12-13 05:23:51
问题 I have a really nasty and persistent problem in assets precompile which I seem not to be able to solve by myself. The compilation always fails in some file that does not have an error. For example the error below is in the file copies.js.coffee that has only a comment. If I delete that file, another file will have the error. The type of all my asset files is us-ascii - no strange characters in any file. I am using Rails 3.1.3. I have tried both with Ruby 1.9.2 and 1.9.3 - no difference. $

getc is obsolete; use STDIN.getc instead

▼魔方 西西 提交于 2019-12-13 04:44:59
问题 When running rake gems:install I see this message: /opt/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:232: warning: getc is obsolete; use STDIN.getc instead How do I resolve the issue? 回答1: The problem was resolved by using sudo command i.e. sudo rake gems:install 来源: https://stackoverflow.com/questions/3479201/getc-is-obsolete-use-stdin-getc-instead

Not able to start Rails server

不羁岁月 提交于 2019-12-12 20:34:47
问题 I am working on Ubuntu 10.04 LTS, Lucid Lynx, have installed Ruby on Rails 3 on it. I am not able to start Rails server. I am getting the following error. mah@mah-laptop:~/Desktop/projects/ver$ rails s /home/mah/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.8/lib/rails/commands.rb:29:in `block in <top (required)>': undefined method `root' for nil:NilClass (NoMethodError) from /home/mah/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.8/lib/rails/commands.rb:27:in `tap' from /home/mah/.rvm/gems/ruby-1.9