title: Delayed_job not working in Ruby on Rails app
body: <p>I'm simply trying to get a function to run at a specific time, but I'm not having much luck. Let me just run through the basics of what I've done</p>
  <pre><code>#Gemfile
  
  gem 'delayed_job_active_record'
  </code></pre>
  <hr />
  <pre><code>#config/application.rb
  
  module SampleApp
    class Application &lt; Rails::Application
      # Settings in config/environments/* take precedence over those specified here.
      # Application configuration should go into files in config/initializers
      # -- all .rb files in that directory are automatically loaded.
      config.active_job.queue_adapter = :delayed_job
    end
  end
  </code></pre>
  <hr />
  <pre><code>#Ran from command line
  
  [06.07.2017/15:38:02] user@ubuntu $ rails g delayed_job:active_record
  Running via Spring preloader in process 72879
     identical  bin/delayed_job
         chmod  bin/delayed_job
        create  db/migrate/20170607203821_create_delayed_jobs.rb
  [06.07.2017/15:38:21] user@ubuntu $ rake db:migrate
  == 20170607203821 CreateDelayedJobs: migrating ================================
  -- create_table(:delayed_jobs, {:force=&gt;true})
     -&gt; 0.0088s
  -- add_index(:delayed_jobs, [:priority, :run_at], {:name=&gt;&quot;delayed_jobs_priority&quot;})
     -&gt; 0.0051s
  == 20170607203821 CreateDelayedJobs: migrated (0.0142s) =======================
  </code></pre>
  <p>So I basically have a button on my view that calls <code>post_now</code>, which then calls a function within a custom model that I have. Here's an example of what I have:</p>
  <pre><code>#posts_controller.rb
    def post_now
      set_post
      submit_post = SchedulePost.delay(run_at: 1.minute.from_now).schedule_post(@post)
      redirect_to posts_path, flash: {success: submit_post[1] }
    end
  </code></pre>
  <p>and then here's the SchedulePost class, which is simply writing a text file (for now)</p>
  <pre><code>#models/schedule_post.rb
  class SchedulePost &lt; ActiveRecord::Base
      def self.schedule_post(post)
          command = &quot;touch #{Rails.root}/public/test.txt&quot;
          system(command)
          return
      end
  end
  </code></pre>
  <p>So what I'm expecting to happen is that when post_now is called, it's supposed to run the schedule_post function 1 minute from now, which is simply supposed to write a text file. If I remove the <code>.delay(run_at: 1.minute.from_now)</code> block and just leave <code>schedule_post</code> there, then it works fine. So I'm definitely doing something wrong here with the delay function.</p>