Build your first Support app - Part 1: Laying the groundwork

Have more questions? Submit a request

22 Comments

  • Patrick Thomas
    Comment actions Permalink

    On Windows 10, in addition to 32-Bit Ruby 2.3.3, I had to install the Ruby Development Kit (for use with 32 Bit versions): download, make a "devkit" folder under the c:/RubyXX directory and expand it into there, simply to remember where it is.


    In that folder, run "ruby dk.rb init" and "ruby dk.rb install".


    For good measure, one should set the RUBYOPT environment variable to "-E utf-8".


    Only then could I gem-install the Zendesk apps tools.


    From then on, it worked well (except that reloading the App iframe within Zendesk does not work, always have to reload the entire page, but maybe I am overlooking something).


    Also, I don't use jQuery for templating but Vue.js instead, but thats just a matter of personal preference and curiosity.


     

    0
  • Patrick Thomas
    Comment actions Permalink

    Sorry, "not using handlebars" for templating. Also, not using jQuery at all.

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Thanks for helping out, Patrick. Also, I see that this is your first post - welcome to the community!

    0
  • Rick Eagle
    Comment actions Permalink

    I have followed the instructions in this article but may have done something wrong.  In the process of installing zendesk_apps_tools I recieve the following message.


    ERROR: Error installing zendesk_apps_tools:
    nokogiri requires Ruby version < 2.4, >= 1.9.2.


    What do I need to do in order to get past this error?  


     

    0
  • Joseph May
    Comment actions Permalink

    Hi Rick-


    You are correct. This is something I would actually suggest you report to nokogiri's developers on their GitHub repository -  this doesn't appear to be a new issue with versioning between OS's. If possible, please try installing an older version of Ruby (2.3.3 was the last minor (& patch) update for version 2).

    0
  • Donatas Gostautas
    Comment actions Permalink

    Hello,


    it is still impossible to install the ZAT on Ruby 2.4. due tothe Nokogiri dependancy and your tools using outdated version of it.


    Please update your GEM file to work with 1.8.2 version of Nokogiri or suggest a method to bypass this.

    0
  • Joseph May
    Comment actions Permalink

    Hi Donatas-


    I will bring this up in our meeting with the appropriate PM. As an alternative, I highly recommend looking into using the Windows Subsystem for Linux (WSL), which I have found circumvents many of the issues surrounding installing and managing Ruby versions. Here are three articles outlining the process:


    System prep for app developers 1: Setting up your command-line interface


    System prep for app developers 2: Managing Ruby versions


    System prep for app developers 3: Installing Node.js


    Regards,


    Joey

    -1
  • Donatas Gostautas
    Comment actions Permalink

    Hello, Joey,


    Thank you for your quick response as well as for sharing these links.


    I wasn't aware of being able to add Ubuntu like that within the Windows up until following the first guide and that is already a huge improvement for my workflow. I haven't gone through all of the steps yet, although considering that I'm using Ubuntu as a Sandbox + Virtual Environments with different version of Ruby, I'm sure I won't encounter any issues along the way.


    Hopefully, you'll update the ZAT dependencies as well.

    0
  • Joseph May
    Comment actions Permalink

    Thank you very much, Donatas, I am happy to hear that. I have a meeting with our PM later this week and I will bring up the dependency issue.

    0
  • Donatas Gostautas
    Comment actions Permalink

    Hello everyone,


     


    So I have managed to build the app and I would now like to package it and install it into my Zendesk. However, when validating/packaging I receive OpenSSL error:


    info Checking for new version of zendesk_apps_tools
    C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)


    Anyone encountered such issue whilst validating their Zendesk applications?

    0
  • Bryan Flynn
    Comment actions Permalink

    Hi Donatas -- check out this article:

    https://support.zendesk.com/hc/en-us/articles/360000520468-zat-error-OpenSSL-SSL-SSLError-on-Windows

    It gives links explaining why the issue is happening as well as how to address it.

    Note that the Ubuntu-using-WSL option mentioned in earlier comments should not have this issue as it's typically a native Windows issue.

    1
  • Vaibhav Agarwal
    Comment actions Permalink

    Please use only Ruby 2.3 version because ZAT works only with that (I'm talking about Windows Platform here) and please before installation install Node Js. 

    0
  • Dharmaprasad17
    Comment actions Permalink

    I have followed the instructions in this article but may have done something wrong. In the process of installing zendesk_apps_tools I recieve the following message.

    $ sudo gem install rake
    $ sudo gem install zendesk_apps_tools
    Building native extensions. This could take a while...
    ERROR: Error installing zendesk_apps_tools:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/eventmachine-1.2.7/ext
    /usr/bin/ruby2.5 -r ./siteconf20180829-709-1bhhp7a.rb extconf.rb
    mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

    extconf failed, exit code 1

    Gem files will remain installed in /var/lib/gems/2.5.0/gems/eventmachine-1.2.7 for inspection.
    Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/eventmachine-1.2.7/gem_make.out

     

    0
  • Bryan Flynn
    Comment actions Permalink

    Dharmaprasad17, please try the approach detailed in System prep for app developers 1: Setting up your command-line interface for setting up your environment. It gives lots of details and makes for a more flexible development environment.

    For Windows users, it also gets around the Ruby2.3/Windows limitation and certificate issues mentioned earlier by using Windows Subsystem for Linux (WSL).

    0
  • Stephane Lebeau
    Comment actions Permalink

    I opted to install Ubuntu over Windows 10, and set up ZAT in that Ubuntu instance.

    In the terminal window, I can start zat server, and if I add ?zat=true to the end of a URL for a given ticket, I see my app window show up in the ticket sidebar on the right. So far, so good...

    However, the contents of the iframe.html are not rendering. In the browser's trace tools, I see the following:

    Mixed Content: The page at 'https://<site>.zendesk.com/agent/tickets/123456?zat=true' was loaded over HTTPS, but requested an insecure resource 'http://localhost:4567/iframe.html?origin=https%3A%2F%2F<site>.zendesk.com&app_guid=<blah>'. This request has been blocked; the content must be served over HTTPS.

    I get that the reason for this is that the zat/Sinatra server in my Ubuntu instance isn't running over HTTPS/SSL, but do you have steps I can follow to set that up? I already created self-signed cert and key files in Ubuntu using openssl, just not sure how to configure zat/Sinatra to leverage those.

    0
  • Bryan Flynn
    Comment actions Permalink

    Hi Stephane. It's not immediately obvious, but make sure your allowing "unsafe content" in your browser:

    ...that in Chrome's address bar you've clicked the shield icon on the right or Firefox's lock icon on the left and agree to "Load unsafe scripts" (Chrome) or "Disable protection" (Firefox).

    It's a bit buried but documented under: Testing an app locally

    1
  • Stephane Lebeau
    Comment actions Permalink

    Thanks Bryan, figured I was missing something obvious!

    0
  • Bryan Flynn
    Comment actions Permalink

    Definitely not obvious! ;-)

    0
  • Vaibhav Agarwal
    Comment actions Permalink

    I still cannot believe that now its almost 2020 and still ZAF / ZAT has Rub v2.3 as its critical dependency and latest versions of Ruby cannot be used. (Taking about using ZAT Server under Windows 7/8/10)

    0
  • Bryan Flynn
    Comment actions Permalink

    Hello Vaibhav. I edited your post to stay on point and conform to Zendesk Community Guidelines

    The sentiment made is valid -- on Windows native, the Zendsk Apps framework Tool (ZAT) requires Ruby 2.3 to run. The workaround described in System prep for app developers is to use the Windows Subsystem for Linux (WSL) and install under that and avoid the version limitation.

    Because that's not a good long term solution and does not meet the needs of everyone, the ZAT utility is being rewritten to eliminate this Ruby version limitation. This new version should be out by Q1 sometime. This has been a long time coming and we appreciate everyone's patience who has been affected by this.

    0
  • Vaibhav Agarwal
    Comment actions Permalink

    Hi Bryan, Sorry for little off way comment. Thanks anyways for understanding the sentiment behind it. 

    In Windows we can easily create Standalone HTTP Services using OWIN (.NET). I hope you can find something similar even for other language frameworks like Phython, java etc.

    However the alternate path of WSL also seems to be valid if your code is solely based on linux bash shell. 

    0
  • Bryan Flynn
    Comment actions Permalink

    No problem Vaibhav and thanks for sharing the .NET points. There is a desire for fully supporting native Windows. The WSL route is helpful for some but not all. For some shops it's not even a possibility, so getting this working is a priority.

    0

Please sign in to leave a comment.

Powered by Zendesk