Coder Social home page Coder Social logo

Comments (22)

fuzzylizard avatar fuzzylizard commented on August 28, 2024

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:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:164:in each' from /usr/local/lib/site_ruby/1.8/rubygems.rb:164:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:49:in gem' from ./config/boot.rb:59:inload_rails_gem'
from ./config/boot.rb:53:in load_initializer' from ./config/boot.rb:38:inrun'
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:ingem_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:inload'
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:inrequire'
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.

javan avatar javan commented on August 28, 2024

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.

joerichsen avatar joerichsen commented on August 28, 2024

I have the same problem. Looking forward to the fix as whenever looks awesome :-)

from whenever.

webandy avatar webandy commented on August 28, 2024

+1 have this same issue. Going to try removing activesupport 2.3.2 since I'm not using it at the moment.

from whenever.

webandy avatar webandy commented on August 28, 2024

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.

tithonium avatar tithonium commented on August 28, 2024

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.

rswolff avatar rswolff commented on August 28, 2024

+1 on this.

from whenever.

javan avatar javan commented on August 28, 2024

Removed activesupport dependency from gemspec. Closed by 6fbb125

from whenever.

javan avatar javan commented on August 28, 2024

Version 0.3.1 was just released and should fix this issue. Let me know if it doesn't.

from whenever.

 avatar commented on August 28, 2024

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:inload'
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:inrequire'
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.

javan avatar javan commented on August 28, 2024

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.

 avatar commented on August 28, 2024

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:inload'
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:inrequire'
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.

javan avatar javan commented on August 28, 2024

It's choking when Whenever loads the Rakefile from your Rails (I assume) app. What's on line 3 of your Rakefile?

from whenever.

 avatar commented on August 28, 2024

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.

javan avatar javan commented on August 28, 2024

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.

 avatar commented on August 28, 2024

Ah, my application's Rakefile does that in line 3:

import File.join(SPREE_ROOT, 'Rakefile')

And my application starts successfully

from whenever.

javan avatar javan commented on August 28, 2024

maybe change that "import" to "load"? i've never seen import in ruby.

from whenever.

 avatar commented on August 28, 2024

That helps!
In Spree (www.spreecommerce.com) that Rakefile uses "import". I change it to "load"

Thank you very much, javan!

Alexander

from whenever.

cowcatcrew avatar cowcatcrew commented on August 28, 2024

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.

 avatar commented on August 28, 2024

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.

yanhackcode15 avatar yanhackcode15 commented on August 28, 2024

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.

javan avatar javan commented on August 28, 2024

@yanhackcode15 0.3.7 was released 7 years ago. Consider using a newer version.

from whenever.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.