# Crontab Issues

**URL:** <https://www.ruby-forum.com/t/crontab-issues/214551>\
**Category:** IronRuby\
**Created:** [December 5, 2011, 4:28pm UTC](https://www.ruby-forum.com/t/crontab-issues/214551 "2011-12-05T16:28:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 5, 2011, 4:28pm UTC](https://www.ruby-forum.com/t/crontab-issues/214551/1 "2011-12-05T16:28:43Z")

</div>

I’m not entirely sure if this is an IronRuby or a Mono issue, but here  
goes! I have a test suite that we’re running on my Ubuntu server that  
works  
fine when I SSH in and run it manually, but when it tries to run from a  
cron job I get the following exceptions:

* * *

WARNING: The runtime version supported by this application is  
unavailable.  
Using default runtime: v1.1.4322

\*\* (/home/rob/code/ironlangs/bin/  
Release/ir.exe:4798): WARNING \*\*: Missing method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.Diagnostics.CodeAnalysis.SuppressMessageAttribute could not  
be  
loaded, used in Microsoft.Scripting

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*:  
Missing  
method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*:  
Missing  
method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeInitializationException: An exception  
was  
thrown by the type initializer for  
Microsoft.Scripting.PlatformAdaptationLayer —\>  
System.TypeLoadException:  
Could not load type ‘System.OperatingSystem’ from assembly ‘mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.  
at Microsoft.Scripting.PlatformAdaptationLayer…cctor () [0x00000] in  
:0  
— End of inner exception stack trace —  
at IronRuby.Hosting.RubyConsoleHost…ctor () [0x00000] in :0  
at Host…ctor () [0x00000] in :0  
at Host.Main (System.String[] args) [0x00000] in :0

* * *

Does anybody know why this might happen?

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![robtotheb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/db5fbb/32.png) [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Post date:** [December 5, 2011, 11:15pm UTC](https://www.ruby-forum.com/t/crontab-issues/214551/2 "2011-12-05T23:15:01Z")

</div>

The error looks to be with running Mono under cron

WARNING: The runtime version supported by this application is  
unavailable.  
Using default runtime: v1.1.4322

That’s indicating mono is loading it’s version of the .NET 1.1 framework  
(which dates to 2003), instead of the .NET 4.0 framework (2010), which  
is  
what is supported.

As to why mono under cron isn’t supporting .NET 4, I’m unsure. I’d  
suspect  
something to do with your PATH or other environment variables that  
differ  
when run under your local user account vs cron.

From: Rob B.ton [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Date: 06/12/2011 04:28 a.m.  
Subject: [Ironruby-core] Crontab Issues  
Sent by: removed\_email\_address@domain.invalid

I’m not entirely sure if this is an IronRuby or a Mono issue, but here  
goes! I have a test suite that we’re running on my Ubuntu server that  
works fine when I SSH in and run it manually, but when it tries to run  
from a cron job I get the following exceptions:

* * *

WARNING: The runtime version supported by this application is  
unavailable.  
Using default runtime: v1.1.4322

\*\* (/home/rob/code/ironlangs/bin/  
Release/ir.exe:4798): WARNING \*\*: Missing method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.Diagnostics.CodeAnalysis.SuppressMessageAttribute could not  
be loaded, used in Microsoft.Scripting

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*:  
Missing  
method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*:  
Missing  
method .ctor in assembly  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll, type  
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: Can’t  
find custom attr constructor image:  
/home/rob/code/ironlangs/bin/Release/Microsoft.Scripting.dll mtoken:  
0x0a00008c

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

\*\* (/home/rob/code/ironlangs/bin/Release/ir.exe:4798): WARNING \*\*: The  
class System.OperatingSystem could not be loaded, used in mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeInitializationException: An exception  
was  
thrown by the type initializer for  
Microsoft.Scripting.PlatformAdaptationLayer —\>  
System.TypeLoadException:  
Could not load type ‘System.OperatingSystem’ from assembly ‘mscorlib,  
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.  
at Microsoft.Scripting.PlatformAdaptationLayer…cctor () [0x00000] in  
:0  
— End of inner exception stack trace —  
at IronRuby.Hosting.RubyConsoleHost…ctor () [0x00000] in :0  
at Host…ctor () [0x00000] in :0  
at Host.Main (System.String[] args) [0x00000] in :0

* * *

Does anybody know why this might happen?

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![robtotheb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/db5fbb/32.png) [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Post date:** [December 6, 2011, 5:17pm UTC](https://www.ruby-forum.com/t/crontab-issues/214551/3 "2011-12-06T17:17:03Z")

</div>

Yep, it was a PATH issue. Seems like cron has an extremely pared down  
PATH  
compared to regular users! Thanks!
