Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to specify rvm gemsets for Rails gem whenever?
    primarykey
    data
    text
    <p>MyApp is using rvm gemset 1.9.3@rails-3.2. It is not default. </p> <p>I am using gem 'whenever' to periodically send email notifications. This is my schedule.rb:</p> <pre><code>every 1.minutes do runner "MyModel.send_emails" # if ... end </code></pre> <p>Cron job is not working unless gemset 1.9.3@rails-3.2 is default. How can i improve my schedule.rb in order to use another gemsets (not only default @global) for my scheduller.</p> <p>I have read official documentation: <a href="https://github.com/javan/whenever" rel="nofollow">whenever</a> and <a href="https://github.com/javan/whenever/wiki/RVM-Notes" rel="nofollow">rvm issues</a> and stackoverflow questions about "rvm gemsets for whenever", but have not found an answer.</p> <p>I have tried to put the following code (according to advice in RVM-Notes) in my shedule.rb:</p> <pre><code>job_type :runner, "{ cd #{@current_path} &gt; /home/####/.rvm/gems/ruby-1.9.3-p448@ rails-3.2/bin/rails; } &amp;&amp; RAILS_ENV=:environment bundle exec rails runner ':task' :output" </code></pre> <p>but it gives no result:</p> <pre><code>ERROR: /home/###/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92 :in `block in materialize': Could not find i18n-0.6.5 in any of the sources (Bundler::GemNotFound) </code></pre> <p>How to specify rvm gemsets for Rails gem 'whenever'? Many thanks!</p> <p><strong>UPDATE</strong></p> <p>1) I have tried to provide rvm notaions for my Gemfile like this:</p> <pre><code>ruby=ruby-1.9.3-p448 # with # sign ruby-gemset=rails-3.2 # with # sign </code></pre> <p>It gives no result. Nothing changes.</p> <p>2) I have tried to modify my ~/.rvmrc. Experiments with full path to bundle, rails gives me the following list of errors:</p> <pre><code> /usr/bin/env: ruby: No such file or directory /usr/bin/env: ruby: No such file or directory /bin/bash: bundle: command not found /bin/bash: bundle: command not found /usr/bin/env: ruby_executable_hooks/usr/bin/env: ruby_executable_hooks: No such file or directory : No such file or directory </code></pre> <p>Here by job_type experiments:</p> <pre><code>#job_type :runner, "{ cd #{path}; } &amp;&amp; RAILS_ENV=:environment bundle exec rails runner ':task' :output" job_type :runner, "{ cd #{path}; } &amp;&amp; RAILS_ENV=:environment /home/###/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle exec rails runner ':task' :output" #job_type :runner, "cd #{path} &amp;&amp; RAILS_ENV=development /home/###/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle exec /home/###/.rvm/gems/ruby-1.9.3-p448@rails-3.2/bin/rails runner ':task' :output" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload