Tag: rake

Rake Task with Cron Job

I am trying to set up cron job to run a rake task daily. I currently have the following cron job (note, the time is all *’s because I want it to run every minute while testing) * * * * * cd /home/jon/thestockenator/lib/tasks/ && ./get_current_data.sh In the shell script I added the entire PATH […]

Capistrano + RVM + Rake task

I have a project which uses rvm ruby 1.9.2 (set in .rvmrc in project dir). deploying with capistrano. has a rake task I want to run remotely from my local machine by capistrano. I’ve created a .sh file to run my task: cd /var/www/pluslook/current /home/kirill/.rvm/scripts/rvm use 1.9.2@pluslook /home/kirill/.rvm/gems/ruby-1.9.2-p180@pluslook/bin/rake parse:feed RAILS_ENV=”production” –trace But when I’m trying […]

NOT able to rake db:migrate

C:\Users\MEGHA>rails new sagar_blog create create README.rdoc create Rakefile … <snip> … Using turbolinks (2.2.1) Using uglifier (2.5.0) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. C:\Users\MEGHA>cd sagar_blog C:\Users\MEGHA\sagar_blog>rails generate scaffold post title:string \ body:text invoke active_record … <snip> … create app/assets/stylesheets/posts.css.scss invoke scss create app/assets/stylesheets/scaffolds.css.scss C:\Users\MEGHA\sagar_blog>rails generate […]

Rails help creating a delayed_job from a rake file

How do I create a delayed job from a rake file. How should I move it into a controller and create a delayed_job that runs the task every 15 minutes. Here is an example how my rake file: namespace :reklamer do task :runall => [:iqmedier, :euroads, :mikkelsen] do # This will run after all those […]

heroku run rake db:migrate – /bin/sh: 1: rake: not found

When I am trying to run heroku run rake db:migrate from Heroku code=H10 desc="App crashed" – Can't figure out why it's crashing I get /bin/sh: 1: rake: not found – git push heroku master # if not done – heroku run rake db:migrate – heroku restart Any suggestions? Logs of the command: 2017-07-08T23:10:22.242114+00:00 app[api]: Starting […]

rake aborted! cannot load such file — indirizzo

I tried running rake db:reset in my rails application after bundle install. The following message is displayed rake aborted! cannot load such file — indirizzo /home/xyz/Desktop/Signup4/app/models/concerns/address_validation.rb:2:in `<module:AddressValidation>’ /home/xyz/Desktop/Signup4/app/models/concerns/address_validation.rb:1:in `<top (required)>’ /home/xyz/Desktop/Signup4/app/models/location.rb:2:in `<class:Location>’ /home/xyz/Desktop/Signup4/app/models/location.rb:1:in `<top (required)>’ /home/xyz/Desktop/Signup4/db/seeds.rb:11:in `<top (required)>’ Tasks: TOP => db:setup => db:seed (See full trace by running task with –trace) bundle show Indirizzo […]

Mechanize on Ruby 1.9.3 encoding issue

Using the following code (from the Mechanize site but in a rake task).. namespace :ans do task :grab => :environment do a = Mechanize.new { |agent| agent.user_agent_alias = ‘Mac Safari’ } begin a.get(‘http://google.com/’) do |page| search_result = page.form_with(:name => ‘f’) do |search| search.q = ‘Hello world’ end.submit search_result.links.each do |link| puts link.text end end end […]

How do you customize the identifier used by MinispadeFilter in rake-pipeline

Per this question: Setting up rake-pipeline for use with handlebars alongside Google App Engine I’m using a MinispadeFilter as my dependency management system via rake-pipeline. The weird thing I’m seeing is the coffeescript and handlebars files have their minispade identifier set to a tmp directory (I’m assuming, where the work is being done). screencast.com/t/wIXmREcreW Is […]

CURSOR_NOT_FOUND – my cron jobs started dying in the middle

a cron job that was successfully running for years suddenly started dying after about 80% completion. Not sure if it is because the collection with results was steadily growing and reached some critical size (does not seem to be all that big to me) or for any other reason. I am not sure how to […]

Why does this require fail from rake but succeed when ran explicitly?

Help me understand why this project’s tests run when executed directly but do not when run via rake. The error when run via a Rake TestTask: ** Execute test /home/myockey/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -I”lib:test” “/home/myockey/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader.rb” “test/unit/data_test.rb” “test/unit/station_test.rb” “test/unit/raw_test.rb” “test/unit/parser_test.rb” “test/unit/report_test.rb” <internal:lib/rubygems/custom_require>:29:in `require’: no such file to load — test/unit/../metar_test_helper.rb (LoadError) from <internal:lib/rubygems/custom_require>:29:in `require’ from test/unit/data_test.rb:4:in `<top (required)>’ from […]

Ruby is the best programming language in the world - Ruby on Rails.