0

I have a Nginx + Passenger + Rails running on port 80, which requires starting nginx with sudo. Now when I go to use whenever, it is also being run as sudo. How do I avoid this?

Here is my logs from log/cron/error.log:

Ignoring bcrypt-3.1.10 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.10
Ignoring bcrypt-ruby-3.0.1 because its extensions are not built.  Try: gem pristine bcrypt-ruby --version 3.0.1
Ignoring bigdecimal-1.2.7 because its extensions are not built.  Try: gem pristine bigdecimal --version 1.2.7
Ignoring binding_of_caller-0.7.2 because its extensions are not built.  Try: gem pristine binding_of_caller --version 0.7.2
/Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-11.2.2 in any of the sources (Bundler::GemNotFound)
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/spec_set.rb:85:in `map!'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/spec_set.rb:85:in `materialize'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:140:in `specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:185:in `specs_for'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:174:in `requested_specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/environment.rb:18:in `requested_specs'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/runtime.rb:13:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler.rb:127:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/setup.rb:18:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from /Users/Passa/Documents/project/config/boot.rb:6:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from script/rails:5:in `<main>'

I have tried running the cron job manually that whenever produces:

/bin/bash -l -c 'cd /Users/Passa/Documents/project && script/rails runner -e development '\''Subscription.renew_user_bandwidth'\'' >> log/cron/cron.log 2>> log/cron/error.log'

but end up getting this error:

Ignoring bcrypt-3.1.11 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.11
Ignoring bigdecimal-1.2.7 because its extensions are not built.  Try: gem pristine bigdecimal --version 1.2.7
/Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find libv8-3.16.14.15 in any of the sources (Bundler::GemNotFound)
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
    from /Users/Passa/.rvm/gems/ruby-2.2.2@divshare-v2/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from /Users/Passa/Documents/project/config/boot.rb:6:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from script/rails:5:in `<main>'
Noah Passalacqua
  • 792
  • 2
  • 8
  • 24
  • do one thing first fix your rake version and then try .If that does't work append `bundle exec` command. In order to fix `rake-11.2.2` go throw [rake-11.2.2](http://stackoverflow.com/a/23291173/3098330) – Gupta Jul 23 '16 at 08:03
  • @VKatz is there a way to tell cron to use the gems that are installed in the project? Also how would I append `bundle exec`? The whenever gem is taking care of making the calls. – Noah Passalacqua Jul 23 '16 at 18:40

0 Answers0