Comments (22)
I am experiencing this bug as well with 2.2.2 and 2.3.2 installed on my production system. Here is my stack trace:
/usr/local/lib/site_ruby/1.8/rubygems.rb:149:in activate': can't activate activesupport (= 2.2.2, runtime), already activated activesupport-2.3.2 (Gem::Exception) from /usr/local/lib/site_ruby/1.8/rubygems.rb:165:in
activate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:164:in each' from /usr/local/lib/site_ruby/1.8/rubygems.rb:164:in
activate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:49:in gem' from ./config/boot.rb:59:in
load_rails_gem'
from ./config/boot.rb:53:in load_initializer' from ./config/boot.rb:38:in
run'
from ./config/boot.rb:11:in boot!' from ./config/boot.rb:109 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from ./Rakefile:4 from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.0/lib/whenever.rb:6:in
load'
from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.0/lib/whenever.rb:6
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.0/bin/whenever:7
from /usr/bin/whenever:19:in `load'
from /usr/bin/whenever:19
from whenever.
Thanks. The quick and dirty fix is to uninstall the version of activesupport you're not using. I'l get a fix in place soon.
from whenever.
I have the same problem. Looking forward to the fix as whenever looks awesome :-)
from whenever.
+1 have this same issue. Going to try removing activesupport 2.3.2 since I'm not using it at the moment.
from whenever.
I am not using Rails 2.3 on my slice yet but I had some of the gems installed. I removed gems returned by gem list | grep 2.3.2
, re-deployed and verified the correct generated crontab file. Thanks.
from whenever.
Just to ditto on the 2.2.2 vs 2.3.2 problem. I need both installed on my mac (personal projects are using 2.3.2, but work project using 2.2.2), so the workaround isn't an option. ::(
from whenever.
+1 on this.
from whenever.
Removed activesupport dependency from gemspec. Closed by 6fbb125
from whenever.
Version 0.3.1 was just released and should fix this issue. Let me know if it doesn't.
from whenever.
Didn't work:
I got the message:
./Rakefile:3: undefined method import' for main:Object (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.7/lib/whenever.rb:6:in
load'
from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.7/lib/whenever.rb:6
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/lib/ruby/gems/1.8/gems/javan-whenever-0.3.7/bin/whenever:7
from /usr/bin/whenever:19:in `load'
from /usr/bin/whenever:19
while my gem list is:
actionmailer (2.3.4)
actionpack (2.3.4)
activemerchant (1.4.2, 1.4.1)
activerecord (2.3.4)
activerecord-tableless (0.1.0)
activeresource (2.3.4)
activesupport (2.3.4)
authlogic (2.1.3)
builder (2.1.2)
calendar_date_select (1.15)
capistrano (2.5.10)
chronic (0.2.3)
compass (0.8.17)
fastercsv (1.5.0)
fastthread (1.0.7)
git (1.2.5)
haml (2.2.15)
haml-edge (2.3.100)
highline (1.5.1)
hoe (2.3.3)
htmlentities (4.2.0)
javan-whenever (0.3.7)
json_pure (1.2.0)
mislav-will_paginate (2.3.11)
mysql (2.8.1)
net-scp (1.0.2)
net-sftp (2.0.4)
net-ssh (2.0.16)
net-ssh-gateway (1.0.1)
passenger (2.2.7)
rack (1.0.1)
rails (2.3.4)
rake (0.8.7)
RedCloth (4.2.2)
rmagick (2.12.2)
rsl-stringex (1.0.3)
rspec (1.2.9)
rspec-rails (1.2.9)
rubyforge (2.0.3)
rubyzip (0.9.1)
searchlogic (2.3.9)
spree (0.9.2)
tlsmail (0.0.1)
from whenever.
You're using an old version of the gem, please upgrade to the newest version (0.4.1 at the moment). Note that it is now hosted at gemcutter.org.
from whenever.
Thank you for the quick response. Unfortunately I still get the same error message:
./Rakefile:3: undefined method import' for main:Object (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever.rb:5:in
load'
from /usr/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever.rb:5
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
from /usr/lib/ruby/gems/1.8/gems/whenever-0.4.1/bin/whenever:7
from /usr/bin/whenever:19:in `load'
from /usr/bin/whenever:19
from whenever.
It's choking when Whenever loads the Rakefile from your Rails (I assume) app. What's on line 3 of your Rakefile?
from whenever.
THe rakefile looks like this:
require 'rubygems'
require 'rake'
require 'lib/whenever/version.rb'
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "whenever"
gemspec.version = Whenever::VERSION
gemspec.summary = "Clean ruby syntax for defining and deploying messy cron jobs."
gemspec.description = "Clean ruby syntax for defining and deploying messy cron jobs."
gemspec.email = "[email protected]"
gemspec.homepage = "http://github.com/javan/whenever"
gemspec.authors = ["Javan Makhmali"]
gemspec.add_dependency("chronic", '>= 0.2.3')
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://gemcutter.org"
end
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/*.rb'
test.verbose = true
end
task :test => :check_dependencies
task :default => :test
So, line 3 is empty
from whenever.
That's Whenever's Rakefile.. Whenever tries to load the Rakefile from YOUR app, and it's dying on line 3 of it: "./Rakefile:3: undefined method `import' for main:Object (NoMethodError)"
from whenever.
Ah, my application's Rakefile does that in line 3:
import File.join(SPREE_ROOT, 'Rakefile')
And my application starts successfully
from whenever.
maybe change that "import" to "load"? i've never seen import in ruby.
from whenever.
That helps!
In Spree (www.spreecommerce.com) that Rakefile uses "import". I change it to "load"
Thank you very much, javan!
Alexander
from whenever.
this issue is still arising for me. my situation is similar to a poster above. the project has rails 2.3.2 vendored, but there is rails 2.3.5 installed on my machine. when it tries to load active_support from the whenever.rb file, i get the NoMethodError.
my workaround is to wrap the call so that it checks if rails is present in vendor first and uses that version if its available. otherwise, it will go through the routine of requiring active support.
from whenever.
just experienced the first listing of this as well...
/opt/ruby-enterprise-1.8.6-20090421/lib/ruby/site_ruby/1.8/rubygems.rb:258:in `activate': can't activate activesupport (= 2.3.5, runtime) for [], already activated activesupport-2.1.2 for ["rails-2.1.2"] (Gem::Exception)
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/whenever-0.4.2/lib/whenever.rb:15
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/whenever-0.4.2/bin/whenever:5
from /opt/ruby-enterprise-1.8.6-20090421/bin/whenever:19:in `load'
from /opt/ruby-enterprise-1.8.6-20090421/bin/whenever:19
I'm on whenever 0.4.2. my quick fix was simply to rescue Gem::Exception with it doing nothing. The pertinent part of lib/whenever.rb is ...
begin
require 'active_support/all'
rescue LoadError
warn 'To use Whenever you need the active_support gem:'
warn '$ gem install activesupport'
exit(1)
rescue Gem::Exception
# nothing
end
ymmv
from whenever.
I'm on 0.3.7, when running $bundle exec whenever, I get the following error:
To user Whenever you need the activesupport gem:
$ sudo gem install activesupport
I then install activesupport and tried $bundle exec whenever, again I get the exactly same error
from whenever.
@yanhackcode15 0.3.7 was released 7 years ago. Consider using a newer version.
from whenever.
Related Issues (20)
- Support for every other hour with offset (1am, 3am, etc.) HOT 3
- Operation not permitted - getcwd (Errno::EPERM) HOT 4
- How to set the daily time as the time of a certain time zone, thank you HOT 1
- How to change the shell by default (bash) ? HOT 1
- How do I "namespace" the crontab entries?
- ActionView::Template::Error (undefined method `>' for nil:NilClass): HOT 1
- Ruby 3.2 autocompletion in console HOT 9
- We need to move from travis-ci to github actions
- How to execute multiple tasks with a single runner ? HOT 1
- whenever command is not working HOT 1
- [Feature Request] Add Dashboard for whenever cron job activity monitoring
- Bundler::RubyVersionMismatch HOT 1
- whenever -w throws incompatible library error HOT 1
- [Feature Request] Pass job frequency as argument to job
- CRON cannot access my database? Could not find table. HOT 1
- Bug: version conflict when running `bundle exec rake test`
- Crontab doesn't work with Rails 7 HOT 2
- Cron jobs inside a docker container HOT 6
- Output redirection to STDOUT
- Bundler: failed to load command: whenever HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whenever.