rake

Ideas For Version Number Control

Here's the development environment we're looking at: Primarily .NET (C# mostly) Development in Visual Studio 2008 Source control in SVN (VisualSVN server, Tortoise client) Deployments with MSBuild/MSDeploy controlled by Rake scripts What we'd like to start having is some kind of tracking of version numbers in deployments. The main r...

Rake usage/alternatives for SQL Server database management in non-rails environment

Short version: Is there a way to use rake without the full rails environment/active record to manage a SQL Server database? Are there alternatives to rake to do so that provide the same feature set? Longer version: I've done some hobby development using Rails but I haven't used it for work nor do I intend to. But from using it, one thin...

create an index without locking the DB

I have a table with 10+ million rows. I need to create an index on a single column, however, the index takes so long to create that I get locks against the table. It may be important to note that the index is being created as part of a 'rake db:migrate' step... I'm not adverse to creating the index manually if that will work. UPDATE: ...

Running rake task from Windows scheduler

Hi, I have a custom Rake file, which I want to run periodically(every day). I am using a Windows machine, and have a .bat file, which basically does cd path/to/applicaion rake filename I am using the windows scheduler to run the bat file but it aborts, complaining that some gems are missing. However, when I start up a command promp...

Albacore: including only certain files/folders in a zip

Hi everyone, I'm trying to zip up the artifacts of a rake build, using Albacore's ZipTask. The solution I'm building has three projects that have artifacts that need to be zipped up individually, but only the ASP.NET MVC project will be mentioned here. Here's the directory structure of the solution: rakefile.rb solution.sln src/ (...

Could not find RubyGem rake (>= 0) (Gem::LoadError)

Hi, I'm having a hellava time with Rails these past two days. I was using the Rails 3 beta gem yesterday but went back to 2.3.8 and after cleaning the system gems and whatnot I'm just trying to run a simple rake task and I get this: Peleliu:haml jayfallon$ sudo rake install /Library/Ruby/Site/1.8/rubygems.rb:779:in report_activate_error...

how to store the name of nested files in a variable and loop through them in rake

I have the following rake file to create a static version of my sinatra app, stolen from http://github.com/semanticart/stuff-site/blob/master/Rakefile class View attr_reader :permalink def initialize(path) filename = File.basename(path) @permalink = filename[0..-6] end end view_paths = Dir.glob(File.join(File.dirname(__...

Rails 3 doesn't have `rake gems:unpack`, what to do?

It seems rails 3 doesn't have rake gems:unpack, what we should use instead? ...

Do Ruby classes get cleared out between Rake tasks

I have a Rakefile that defines the spec task as task :spec => [:check_dependencies, :load_backends] And then runs the actual rspec tests. During the load_backends task, it loads a class called Story, but in the first spec test, defined?(Story) returns false. I'm assuming that it is intended behavior of Rake to start with a fresh env...

Where is this newline coming from?

I'm using a rake script to tag the AssemblyInfo.cs files in my .NET projects, but there's a phantom carriage return (or newline, etc.) being introduced that's breaking the compilation. The method that gets the version number is: def get_version() version = '' IO.popen("#{SVNVERSION_APPLICATION} #{build_info.root_dir}") do |output| ...

Rails 3.0 & Ruby 1.9.2rc: Rake commands return 'already initialized constant' & stack level too deep errors. Any ideas

Hi Folks, I'm trying to run Rails 3 beta 4 & Ruby 1.9.2rc on Ubuntu 10.04. It worked initially, but after doing my first bundle install/package, I now get the following errors in all rails projects. Even a basic 'rails new testproject' followed by a rake brings up the error messages. In short, I'm stumped. Any help regarding what could...

Rake on windows - copy directory to another server

Hi, I want to use rake to deploy a .net website to a windows server... Bit new at this and getting stuck with the very simple stuff... How would I copy a directory from a local folder to a different windows server? At the moment I have: task :default => :CWS_Web_application desc 'Depoly CWS Web application to preview environment' t...

Rails DB Seeding

For some reason, the food_id field in 'ratings' isn't populating when I run the seed.rb file below. Can somebody help me figure out why? Seed file contains the following lines: Food.create(:id => 1, :description => 'Stonyfield Farm Yomommy 4oz. Strawberry') OverallRating.create(:score => 0, :count => 1, :food_id => 1) Code for Food ...

using rake with project directory structure

I have been looking into Rake for build script in our CI system (Projects built with C++). I have been playing about with a simple 'hello world' application to see what rake is capable of doing. All was well until i decided to put the .h files into a include folder and the .cpp files into src folder. Rake was able to find the .cpp files ...

Rake:task equivalent in Django

I have a django application where i'll like to have a script that i'll run once a day to validate the models in the database, and delete some objects. How cand i make it ? I want something equivalent to rake:task in rails. ...

Rake db:populate - Simulating a 'calendar of events'

I need to get populator to build me an order history such that: The record has a start_date and end_date Each record specifies a period between 0 and 5 years Events are pretty much consecutive (meaning the end date of record n affects the start date of record n+1) There can be gaps between events (periods of no orders) but no overlaps ...

JRuby: Rake fails with Gem::Version error

I get the following error on any call to rake. I am working on a Rails 3 running on JRuby (1.5.1) installed with RVM. I don't think this was always the case, but I'm not sure how to track it down. Am I correct in think this has something to do with the gems I have installed (listing included below)? $ rake metrics:all /Users/Eric/.rv...

rubyon rails, rake, crontab and encoding

I have a rails rake task which runs just fine. I want this task to be run periodically by crontab so I added it to crontab as follows : 0,30,0 * * * * cd /var/www/html/metajorn && RAILS_ENV=production /usr/local/bin/rake myraketask --trace >> /var/www/html/metajorn/log/cron_log.log 2>&1 In cron_log.log I'm seeing the following error...

Rake can't be found

hey i played around with bundler and some gems and now i can't use rake anymore if i do a simple db:migrate i get this error: mac:app antpaw$ rake db:migrate /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:335:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception) from <internal:gem_prelude>:282:in `method_missing'...

How can I force Rails to load all models?

Rails does model loading on demand. For a rake task that I'm writing, I need to be able to iterate over all ActiveRecord::Base instances (which is possible with ActiveRecord::Base.send(:subclasses)). However, for the above to work, they have to already be loaded. Anyone know of a way to force all models to load? Ideally I'd like to n...