Most probably because the syntax is wrong. ( you are using wrong characters of double quotes " and not using or missing single quotes '… not proper usage of String literal etc. )
You can check e.g. the following topics regarding " Dynamic Components is a proprietary , closed-source native extension…" :
https://forums.sketchup.com/t/error-while-adding-custom-attributes-through-ruby/123238