Java Ruby PHP and more
RSS icon Email icon Home icon
  • Bowline on Windows with different Titanium Version

    Posted on August 13th, 2009 Tobias.Braner 1 comment

    This stuff was tested on Vista but should also work on XP.

    Two problems are solved in this article:

    • Install bowline on another OS then it was developed on
    • Run bowline with another version of Titanium Desktop then it was developed on

    Bowline was developed on Mac OS X and uses the version 0.4.4 of Titanium. I have installed it on Vista and tried to run the bowline-twitter example with Titanium 0.6.0. This is how I installed it and how I managed to solve the problems:

    1. Install bowline
    To install bowline ruby gems can be used:

    gem install maccman-bowline --source http://gems.github.comI’ve got some dependency errors. E.g. I had now active support and newgems installed. Install the other gems first (I think gem has also a dependency switch –include_dependencies or similar - I’m not sure).

    2. Install Titanium Desktop
    Donwload it from http://www.appcelerator.com/products/titanium-desktop/ and execute the installer.

    3. Get the bowline-twitter example from github
    You can get the bowline-twitter example from this URL: http://github.com/maccman/bowline-twitter/tree/master. After unpacking I renamed it to “twitter” and saved it c:/dev/bowline/twitter.

    4. Building the twitter client
    Open a command line, change to the project directory (c:/dev/bowline/twitter in my case) and execute the following command:

    rake appI’ve got this error:

    C:\dev\bowline\twitter>rake app
    (in C:/dev/bowline/twitter)
    rake aborted!
    Exec format error - C:/ProgramData/Titanium/sdk/win32/0.6.0/tibuild.py -d C:/dev/bowline/twitter/build -s C:/ProgramData/Titanium -a C:/ProgramData/Titanium/sdk/win32/0.6.0 C:/dev/bowline/twitter/build/app
    Background: bowline was created on Mac OS X. On the Mac console, which is called bash, files have a line which tells the OS which program should execute them. E.g. the run file in the folder twitter/script:

    #!/usr/bin/env rubyrequire
    File.join(File.dirname(__FILE__), *%w[.. config boot])
    require “bowline/commands/run”
    From the first line Mac Os knows to start this file with ruby. So in the command line you can just type:

    script/runIn windows you have to type:

    ruby script/runWindows doesn’t recognice first line. In the build script for bowline a python script should be executed but windows doesn’t know that it is a python script. Step 5. will explain how you can change it.

    5. Changes in the build file app.rake
    This file can be found in

    %ruby_home%\gems\1.8\gems\maccman-bowline-0.4.6\lib\bowline\tasksLine 146 and following reveal that a python script tibuild.py is called. This is part of Titanium Desktop. So you have to install Python. I’ve got Python 2.6 installed. Please also make sure that the Python path is also in you environment variable PATH (Control Panel > System > Advanced System Settings > Environment Varibales > PATH). E.g. my path variable contains besides many other entries C:\dev\Python26\ . Remember that different paths have to be seperated by ; without space.

    Back to app.rake. Find the following line (146):

    command = []And now add another line:

    command = []
    command < < "python"
    Now the command line error is solved. But there is another thing which has to be changed in app.rake. The python script mentioned above also parses the manifest file of the project which contains meta information, like the author, name and dependencies. It also determines the required runtime version of the project. The twitter client was built on Titanium Desktop 0.4.4, I have 0.6.0 installed. This leads to an error, so I had to change this in the app.rake.

    I replaced all versions from 0.4.4 to 0.6.0 in app.rake.

    6. Try to build it again
    Command Line:

    rake appStill an error:

    C:\dev\bowline\twitter>rake app
    (in C:/dev/bowline/twitter)
    Couldn't determine your source distribution for packaging runtime version 0.4.4. Please specify.
    Still the version error. If you open the manifest in twitter/build/app/ you can see that there is still the version 0.4.4 inserted. So you have to regenerate the manifest (step 7).

    7. Regenerate the manifest
    Command line:

    rake app:configure8. Final build
    Command line:

    rake appThis builds you app and is not necessarily needed if you just want to run it.

    9. Run the twitter client
    Command line:

    ruby script/runWorks! :)

    Bowline is very interesting but also very young. I hope that the Author, Alex MacCaw, will drive the development further so that it really gets usable.

    Links:
    Blog Post of Alex MacCaw
    Blog Post on RubyInside
    Bowline on github
    Bowline-Twitter on github
    Titanium Desktop

     

    One response to “Bowline on Windows with different Titanium Version” RSS icon

    • Thanks for the writeup, I’ve fixed that issue you were seeing with the in-explicit python and will release a new gem soon.

      At the moment I’m working on fixing threads and upgrading to Ruby 1.0

      Alex

    Leave a reply