rake

Thread tried to join itself

I am working on building a Ruby on Rails v2.3.8 real estate application. I've written a rake task to pull in the property listings and photos. The app uses rets4r (specifically josephholsten-rets4r) to talk to a RETS-based server and Paperclip is used to manage the property photos and push them up to S3. The problem I'm seeing is the ra...

Can i use rak command inside rake task ?

I have install gem rak i want to use rak command inside rake task ... How may i use that ?? I know how to use it on command prompt ... This is working fine on command prompt ... rak RAILS_ENV ...

rake background task can not run

I want to use rake background task in rails like this system("cd #{Rails.root} && RAILS_ENV=#{Rails.env} rake abc:def --trace 2>&1 >> #{Rails.root}/log/rake.log &") This is ok in development environment, but will not work in production mode. I used logger to check whether the command string is generated ok or not, but it seems every ...

Returning a variable value to a rake script

I'm executing a rake script that calls a powershell function. The function returns a value, how can i get this value and provide it to my rake template file? Thanks for any suggestions ...

Trouble with Ruby on Rails with Rake

Hello Everybody, I'm very new to Rails, so please forgive my lack of understanding. I've installed the latest versions of RubyGems, Ruby, Rails, Rake, and MySQL etc via RubyGems, but I have this problem when starting to make a basic Rails app: Icarus:temporary atg$ rails new people ... (output omitted) ... Icarus:temporary atg$ cd ...

Rake trouble finding MySQL after uninstalling Rails 3.0.0

So I thought I had fixed the problem posted in this question and I uninstalled Rails 3.0.0 with sudo gem uninstall rails -v 3.0.0, but then I had troubles with other things. I took rogerdpack's advice to a different level and uninstalled all of my ruby gems and mysql, then reinstalled them. Now I get the following: Icarus:temporary atg...

Ruby / Rails - A better way of running post-deploy tasks?

We're hosting our Ruby on Rails application with the EngineYard App Cloud, which has worked really well for us. They provide a series of deploy call backs (before_restart, after_restart, etc.) which are analogous to Capistrano's callbacks. We have a series of Rake tasks within our application which maintain various parts of the applica...

What is the purpose of Rake?

I know Rake stands for Ruby Make, and I know Make is a unix build utility. Now, I come from working in Xcode building iPhone apps to Ruby, so I have never used Make before, and the only time I use rake is when in rails or installing some third party package and I type a command like rake db:migrate. The things I don't understand are ... ...

Rake db:migrate error "don't know how to build task"

I've got a table where I used integer on a field which needs decimal places, so I'm trying to create a migration which changes the field type from integer to float/real. My database is sqllite3 and I'm using rails3. I ran rails generate migration ChangeMeasureColumnOnIngredients to create the initial migration files, then updated th...

Rails: run rake tasks like migrations

My dev team needs to more precisely run rake tasks. There are certain tasks that need to be only run once after a specific code change. Without getting too specific, it would be like needing to update certain existing users records after a new business rule for new users is implemented in the code. We like how migrations use a db table...

Rails Unit Test Issue with rake

Hey guys, 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.dirname(__FILE__) + '/../test...

RoR: Error when doing rake command db:create => rake aborted! no such file to load -- initializer

Hello, I just installed a fresh new version of Ubuntu 10.04 and wanted to get my rails projects working. I checked out a rails project 2.3.3 and fill in the databasye.yml file with the typical sqlite-settings: # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: d...

How do I run rake tasks within my rails application.

What I want to do: In a model.rb, in after_commit, I want to run rake task ts:reindex ts:reindex is normally run with a rake ts:index ...

Rails3 mysql2 rake error

hi, 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 #<Mysql2::Error:0x1024f21f0> (See full trace by running task with --trace) noname:addressDB cleme...

"No Rakefile found" when I run "rake gems:refresh_specs"

When I run my app I get this error: config.gem: Unpacked gem rakismet-0.3.6 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. And when I run: rake gems:refresh_specs I get: No Rakefile found I've tried the rake command from various directories within the application hierarchy with no success....

Rails plugin: undefined method 'mattr_accessor' for Sentry:Module

I'm looking at an existing Rails project and trying to see what rake tasks exist by running rake -T. However, when I run that I get: (in /var/www/project) rake aborted! undefined method `mattr_accessor' for Sentry:Module /var/www/project/Rakefile:10 (See full trace by running task with --trace) vendor/plugins/sentry/tasks/sentry.rake ...

Rails.root is Empty in Custom Rake Task in Rails 3.0

Maybe I missed this in the upgrade documentation, but if I output "Rails.root" in the rails console I see my app's root path. But if I reference "Rails.root" in a custom Rake task, it's empty. What am I missing? Thanks in advance. Sample: namespace :admin do desc "Import some data" task :import => :environment do csv = ...

How do you generate a new Rakefile for a Rails app that has "lost" its Rakefile?

Somehow my Rails app doesn't have a Rakefile. I don't know if it lost it or what. So when I run: rake gems:refresh_specs I get: No Rakefile found How do I generate a new Rakefile to refresh my gem specs? ...

Missing RedCloth gem but `rake gems:install` does nothing

I tried starting my Rails application but got this error message from Passenger: Ruby on Rails application could not be started The application has exited during startup (i.e. during the evaluation of config/environment.rb) /home/chuck/chuck.com/vendor/rails/railties/lib/rails/gem_dependency.rb:119: Warning: Gem::Dependency#version_...

How to make sure only one rake task is running at a time?

Hi guys! I want to setup rake tasks to run via cron. That is easy, but what is not easy is ensuring that only one copy of that rake task is running at a time. I imagine I could use ps on the system to check and then exit the rake task if it is already running, or I could do a delayed job structure where I serialize the name of the task...