rake

Rails: rake db:migrate isn't output to script/server console window

i have two cmd consoles opened in Windows. One is running the "ruby script/server" the other i run a "rake db:migrate" command. But the server console doesn't output the log of the migration? Someone has an idea what's the reason? ...

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?

Does rake db:schema:dump recreate schema.rb from migrations or the database itself? thanks ...

How to move your rake tasks to the rails lib dir from in a gem generator?

Im creating a custom gem and have some rake files that need to be installed into the users /lib/tasks directory to work. I want create a generator that will move / create my rake tasks in the tasks directory so they can use them. Does anyone have any idea how do to this in a custom gem? ...

Using a rake task that accepts parameters as a prerequisite

According to http://rake.rubyforge.org/files/doc/rakefile_rdoc.html, you can create a task that accepts parameters and also has prerequisites: task :name, [:first_name, :last_name] => [:pre_name] do |t, args| But what if :pre_name is a task that also accepts parameters? What is the syntax for passing parameters to :pre_name when it is...

Copying files during compilation process

I use builder for my buildprocess. I have some java classes in my src directory as well as some *.qvto files. These files just need to be copied to target/classes. However, this should be done as part of the compilation process, as these files represent some part of code that does not need to be compiled. Currently, I am stuck and do n...

rails3 rake does not run my tests

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_n...

Does rake db:populate work in Rails 3?

I'm having huge problems with my populate.rake file - after importing my existing file from my Rails 2.3.5 installation, Rails 3 wants nothing to do with it. I'm getting tens (if not hundreds) of errors in my console, many of them for simple statements, and some even in the middle of a string of plaintext. Has the syntax changed for Rai...

Rails Database Back-up Script

Hello, I currently use the script below to back-up a website but it could be improved dramatically! Please could you suggest any improvements, or perhaps alternative solutions? Currently, I only delete items after a massive amount has been reached - and this is not good. Does anyone know how I can delete items that are a month old, o...

Background Rake Task Help

I would like to create a Rake task that: checks a column in a table row and if its value is false, sends an email with the row information, and then change the value from false to true. Does anyone know the best way to approach this? ...

How can I get control of gem installation locations?

Lots of confusion and difficulty related to gem installation. My gem environment: RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10] - INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /opt/local/bin/ruby - EXECUTABLE DIRECTORY: /opt/local/bin...

psake vs. rake for .NET builds

I'm investigating build tools for use with an ASP.NET MVC 2 application. I like the idea of using a scripting language rather than XML, and have narrowed my choices down to psake or rake. I don't have much experience with Ruby or PowerShell, but am willing to learn either. I don't mind installing Ruby on my build server if that's my best...

Can't get RDoc to suppress cross-references for a specific word

I'm using the jeweler gem when developing new gems. As part of the skeleton, it sets up a set of RDoc related rake tasks - the main one being rake rdoc. As far as I can tell from the Rakefile, this task uses the rake/rdoctask library to generate HTML documentation from my RDoc comments. It tries intelligently to make references to class...

runing rake task

Hi! Why when i run task : my_project> rake import:twitter Task.path: lib/task/import_twitter.rake namespace :import do task :twitter => :environment do puts "importing...." end end then tests also run? In the console output: importing.... Loaded suite C:/Ruby/bin/rake Started Finished in 0.001 secon...

Rake failing to start

I'm having trouble understanding the following error with Ruby's Rake. C:\>gem install rake Successfully installed rake-0.8.7 1 gem installed Installing ri documentation for rake-0.8.7... Installing RDoc documentation for rake-0.8.7... C:\>rake C:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable r ake for...

Seeding file uploads with CarrierWave, Rails 3.

I'm trying to seed a database in Rails 3 with images using CarrierWave, however nothing I try seems to work short of having to upload them all by hand. pi = ProductImage.new(:product => product) pi.image = File.open(File.join(Rails.root, 'test.jpg')) pi.store_image! # tried with and without this product.product_images << pi product.save...

Rake db:seed - can I index Sphinx from there?

Is it a good idea to run rake thinking_sphinx:index from db/seeds.rb file? So that it will look like: #create some items #run rake thinking_sphinx:index Main intention behind that is to get fully functional environment after populating it with seed data. It is applied only to development env. ...

Ruby on Rails' "rake rails:freeze:gems" or "rake gems:freeze GEM=..." won't freeze files into "vendor" folder?

I was trying to use rake gems:freeze GEM=facebooker2 but then rake won't support it. (using rake 0.8.7, gem 1.3.7, rails 2.3.8, ruby 1.8.7) So looks like the current supported freezing is rake rails:freeze:gems but after I do that, I use hg status | grep facebooker (similar to git status, to see what files are added or modified) ...

Exception generated during rename_column migration

I'm trying to change a column in my sqlite DB via a migration...and I have no idea what I'm doing with RoR so please be gentle! Here's the migration I'm trying to run. class FixContactIdColumn < ActiveRecord::Migration def self.up rename_column :calls, :contact, :contact_id end def self.down end end And here's the except...

Rails: specific rake task dependencies for different environments

Hi My main rakefile has some tasks to stop and start selenuim as follows: require 'selenium/rake/tasks' Selenium::Rake::RemoteControlStartTask.new do |rc| rc.port = 4444 rc.timeout_in_seconds = 3 * 60 rc.background = false rc.wait_until_up_and_running = true rc.additional_args << "-singleWindow" end Selenium::Rake::RemoteC...

Rake without RAILS_ENV variable gives 'DEVELOPMENT' while RAILS_ENV_PRODUCTION results in TRUE

To explain this issue I wrote the following rake task namespace :tutorial do desc 'tutorial' task :env =>:environment do puts "RAILS_ENV: #{RAILS_ENV}" puts "RAILS_ENV_PRODUCTION: #{RAILS_ENV_PRODUCTION}" puts "RAILS_ENV_TEST: #{RAILS_ENV_TEST}" end end When I run the following commands: rake tutorial:env it will return ...