<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Wolfgang Lutz on Medium]]></title>
        <description><![CDATA[Stories by Wolfgang Lutz on Medium]]></description>
        <link>https://medium.com/@wlut?source=rss-17a64b696cbc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*50P3F4Wf2zmoYHL8.</url>
            <title>Stories by Wolfgang Lutz on Medium</title>
            <link>https://medium.com/@wlut?source=rss-17a64b696cbc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:46:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wlut/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Better iOS projects: How to manage your tooling with mint]]></title>
            <link>https://medium.com/number42de/better-ios-projects-how-to-manage-your-tooling-with-mint-90feb2572e1b?source=rss-17a64b696cbc------2</link>
            <guid isPermaLink="false">https://medium.com/p/90feb2572e1b</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[Wolfgang Lutz]]></dc:creator>
            <pubDate>Tue, 03 Jul 2018 00:00:00 GMT</pubDate>
            <atom:updated>2018-07-04T08:21:44.035Z</atom:updated>
            <content:encoded><![CDATA[<p><em>July 3, 2018, by </em><a href="https://number42.de/#team"><em>Wolfgang Lutz</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rp9QfO391FFTRq-K.png" /></figure><p>In the series “Better iOS projects”, we have a look at the various tools and environments that are useful to have a more convenient and efficient handling of iOS projects.</p><h3>How to manage your tooling with mint</h3><p>Since the (still recent, in comparison to other languages) release of the Swift programming language, a lot of tooling has been added to support developing in it.</p><p>We got <em>SwiftLint</em> to lint our code, <em>SwiftFormat</em> to apply format and coding guidelines, <em>SwiftGen</em> to get rid of all the string-dependent API calls and <em>Sourcery</em> to generate huge amounts of code we would have to tediously write by hand otherwise.</p><p>But all this tooling is third-party and because of this, we need to manage it by ourselves.</p><p>Some of the approaches on how to install these tools are:</p><ul><li>download a binary</li><li>install it via <em>CocoaPods</em></li><li>install it via <em>Homebrew</em></li></ul><p>There are some downsides to these approaches:</p><ul><li>The method of installation might not be supported: Not all dependencies are available as a binary AND via <em>CocoaPods</em> AND via <em>Homebrew</em>, so you end up with a mix of systems.</li><li>You depend on the update being published to the manager you use, which can take some time.</li><li>You cannot specify the exact version to use.</li><li>You might need to clutter your repository with large binary blobs.</li></ul><h3>What do we need from a Tool-Version Manager?</h3><p>You want to have the <strong>exact same version</strong> of the tool for you, your team members and your CI Server. This way, all the tools behave the same way across your development team and everybody gets the same warnings and generates the same code, thus avoiding differences in behavior.</p><p>You do not want to have to be forced to update your tooling on the day you want to give your App into review, so you need to be able to <strong>install a specific version</strong> instead of having to use the most up to date version of the tool. This helps to avoid problems in the case there is a bug in the newest version of the tool you are using (happened to us with <em>Sourcery</em>).</p><p>You want to be able to install a <strong>specific version per project</strong>. Different projects have different needs for synchronization. Having a tool as a global dependency just does not work in some cases.</p><h3>What is the Problem with brew?</h3><p><em>Homebrew</em> is a really great tool for providing terminal tools. Installing additional tools is a charm. But: for most tools, <em>Homebrew</em> no longer has the option to install a specific version of the tool. As you can not go back to a previous version, the only way to keep versions synchronized across team members is to install the latest version available. This becomes absolutely infeasible for agencies with lots of projects and additional external developers. Somebody will always forget to upgrade brew. Installing your own internal tools is possible by creating your own <em>Homebrew</em> tap, but it adds some additional overhead and maintenance.</p><p><a href="https://github.com/yonaskolb/Mint">Mint</a> is a dependency manager that internally uses Apple’s Swift Package Manager (SPM) to build swift tools. If the tool is written using SPM (which is the way to go to be able to use external dependencies for CLI, see <a href="https://www.swiftbysundell.com/posts/building-a-command-line-tool-using-the-swift-package-manager">this great post by @JohnSundell</a>) it usually can be built using mint without a problem. So far, <em>SwiftLint</em>, <em>SwiftFormat</em>, <em>Marathon</em>, <em>XcodeGen</em> and <em>Sourcery</em> are some of the most relevant tools that can be installed using mint. <em>SwiftGen</em> will be installable when the next version (v6.0) is released.</p><h3>Install mint</h3><p>You can find several ways to install mint on <a href="https://github.com/yonaskolb/Mint">GitHub</a>.</p><p>One easy way is to run</p><pre>brew install mint</pre><h3>mint run</h3><p>To just run a package, type</p><pre>mint run &lt;repo-name&gt;</pre><p>e.g.</p><pre>mint run yonaskolb/xcodegen</pre><p>This installs and runs the latest version.</p><p>To run a specific version, you can add a release tag or a branch or a git commit hash:</p><pre>mint run yonaskolb/xcodegen@1.8.0</pre><p>You can also pass git URLs like git@github.com:yonaskolb/Mint.git to the install command. This allows you to also install and run internal, non-public tools from their repositories.</p><h3>mint install</h3><p>To install a specific version for later use, you can use mint install:</p><pre>mint install yonaskolb/xcodegen@1.8.0</pre><p>This installs the given version (and links it to usr/local/bin).</p><h3>How do I use the Mintfile?</h3><p>To define the versions to use in your project, you can add a file called <em>Mintfile</em> to your project’s root folder. In it, you can define the tools to use along with their versions:</p><pre># This is a comment<br>krzysztofzablocki/Sourcery@0.13.1<br>realm/SwiftLint@0.25.1<br>yonaskolb/XcodeGen@1.8.0<br>nicklockwood/SwiftFormat@0.33.7</pre><p>For commands run in this folder, that do not contain a version specification, <em>mint</em> will look up the version in the <em>Mintfile</em>.</p><p>So, running</p><pre>mint run xcodegen</pre><p>with the <em>Mintfile</em> present will install and run version “1.8.0” instead of a newer version. Note that you can leave out the user part (e.g. “yonaskolb/”) as it is defined in the <em>Mintfile</em> already.</p><h3>mint bootstrap</h3><p>Running</p><pre>mint bootstrap</pre><p>installs the versions defined in the <em>Mintfile</em> (without linking them), so that you are prepared to use the versions from inside your buildscripts in <em>Xcode</em>.</p><h3>Automating the installation via mint</h3><p>At Number42, we always include a script called <a href="https://github.com/num42/n42-buildscripts/blob/master/bootstrap.sh">bootstrap.sh</a> in our projects, which does the most basic setup calls needed to run the project afterwards. Whenever something does not work out of the box after cloning (or pulling) a project, calling sh bootstrap.sh is able to sort out the larger part of problems in most cases. We use this the same way for iOS and web projects. We will have a closer look at the bootstrap script in an upcoming episode of this series.</p><p>This is an excerpt of the script, which shows how we install <em>mint</em> and run mint bootstrap:</p><pre>#!/bin/sh</pre><pre>brew update</pre><pre>function install_current {<br>  echo &quot;trying to update $1&quot;<br>  # <a href="https://docs.travis-ci.com/user/reference/osx/">https://docs.travis-ci.com/user/reference/osx/</a><br>  # avoids errors<br>  brew upgrade $1 || brew install $1 || true<br>  brew link $1<br>}</pre><pre>if [ -e &quot;Mintfile&quot; ]; then<br>  install_current mint<br>  mint bootstrap<br>fi</pre><h3>What to do if something is broken</h3><p>Mint installs tools to /usr/local/lib/mint, so you can delete files here if something goes wrong.</p><h3>Acknowledgments</h3><p>Thanks to <a href="https://github.com/yonaskolb">Yonas Kolb</a> for reviewing this article before release. Illustration by <a href="https://number42.de/#team">Melanie Kloss</a>.</p><p><em>Originally published at </em><a href="https://www.number42.de/blog/2018/07/03/mint-2018-07-03-mint.html"><em>www.number42.de</em></a><em> on July 3, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90feb2572e1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/number42de/better-ios-projects-how-to-manage-your-tooling-with-mint-90feb2572e1b">Better iOS projects: How to manage your tooling with mint</a> was originally published in <a href="https://medium.com/number42de">Number42</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Better iOS Projects: Advanced Usages of rbenv]]></title>
            <link>https://medium.com/number42de/better-ios-projects-advanced-usages-of-rbenv-9d3fe078d5e6?source=rss-17a64b696cbc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d3fe078d5e6</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Wolfgang Lutz]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 07:48:17 GMT</pubDate>
            <atom:updated>2018-06-11T07:48:17.497Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lU3EloSLECWEkKUFx3OyAQ.png" /><figcaption>Digging deeper with ruby</figcaption></figure><p>In the series “Better iOS Projects”, we have a look at the various tools and environments that are useful to have a more convenient and efficient handling of iOS Projects.</p><h4>Special Note</h4><p>You should not have to use root user permissions via <em>sudo</em> for any of the calls that follow. If you seem to need to, you most likely already had a permission problem before or you did not install and setup <em>rbenv</em> correctly.</p><h4>Advanced Usages of rbenv</h4><p>In the previous post of the series “Better iOS Projects”, <a href="https://medium.com/number42de/ios-projects-done-right-how-to-manage-the-ruby-environment-of-your-ios-project-using-rbenv-fafac4f32d3f">How to manage the ruby environment of your iOS Project using rbenv</a>, we learnt to install and use <em>rbenv</em> and <em>bundler.</em> Now we have a look at some of the more advanced features and pitfalls of using <em>rbenv</em> and <em>bundler</em>.</p><h4>How do I use bundler in <em>ruby</em>-scripts?</h4><p>To ensure that the correct versions of gems are used inside a ruby script, you need to require <em>rubygems</em> and <em>bundler/setup</em> at the top of the script:</p><pre>#!/usr/bin/ruby<br><br># Non-Bundler Dependencies<br>require &#39;optparse&#39;<br>require &#39;ostruct&#39;<br><br># Support for Bundler and Gems<br>require &#39;rubygems&#39;<br>require &#39;bundler/setup&#39;<br><br># Now, the version of xcodeproj defined via Bundler is used<br>require &#39;xcodeproj&#39;</pre><h4>Using binstubs</h4><p>To ensure that all calls use the version defined in the <em>Gemfile</em> without prefixing the call with bundle exec, you can append --binstubs along with the gems to stub to the installation command:</p><pre>bundle install --binstubs fastlane</pre><p>It is recommended to explicitly name the gems you want to stub to avoid conflicts with gems that deliver their own stubs, e.g. <em>rails</em>.</p><p>Then, you can call the command by prepending bin/, e.g.</p><pre>bin/fastlane</pre><p>You can also add export PATH=&quot;./bin:$PATH&quot; to your shell&#39;s rc file (see above) to always search the bin folder (where binstubs are installed to) when running commands. This might have <a href="https://github.com/rbenv/rbenv/wiki/Understanding-binstubs">security implications</a> though. If you do this, it is enough to type</p><pre>fastlane</pre><p>As an alternative to binstubs, you can also add the alias alias be=&quot;bundle exec&quot; to your .rc file, to make the original call shorter:</p><pre>be fastlane</pre><h4>Bonus: How to automate installing the correct ruby version and gems</h4><p>At Number42, we always include a script called <a href="https://github.com/num42/n42-buildscripts/blob/master/bootstrap.sh">bootstrap.sh</a> in our projects, which does the most basic setup calls needed to run the project afterwards. Whenever something does not work out of the box after cloning (or pulling) a project, calling sh bootstrap.sh is able to sort out the larger part of problems in most cases. We use this the same way for iOS and web projects. We will have a closer look at the bootstrap script in an upcoming episode of this series.</p><p>This is an excerpt of the script, which shows how we install <em>ruby</em>, <em>Bundler</em> and <em>Gems</em>:</p><pre>#!/bin/sh<br><br># exit script on error<br>set -e<br><br># define colors<br>RED=`tput setaf 1`<br>GREEN=`tput setaf 2`<br>NOCOLOR=`tput sgr0`<br><br># Guard to update brew only once and only if necessary<br>NEEDS_TO_UPDATE_BREW=1<br><br># Helper to install brew dependencies<br>installDependencyWithBrew(){<br>  if [ $NEEDS_TO_UPDATE_BREW -eq 1 ]; then<br>    echo &quot;&quot;<br>    echo  &quot;${GREEN} UPDATING BREW ${NOCOLOR}&quot;;<br><br>    # update brew to keep dependencies up to date<br>    brew update || echo &quot;${RED} FAILED TO UPDATE BREW ${NOCOLOR}&quot;;<br>    NEEDS_TO_UPDATE_BREW=0<br>  fi<br><br>  echo &quot;&quot;<br>  echo  &quot;${GREEN} INSTALLING $1 WITH BREW ${NOCOLOR}&quot;;<br><br>  # install dependency, if is not installed<br>  brew list $1 || brew install $1 || echo &quot;${RED} FAILED TO INSTALL $1 ${NOCOLOR}&quot;;<br><br>  # upgrade dependency, if it is outdated<br>  brew outdated $1 || brew upgrade $1 || echo &quot;${RED} FAILED TO UPGRADE $1 ${NOCOLOR}&quot;;<br>}<br><br># Install ruby if a .ruby-version exists<br>if [ -e &quot;.ruby-version&quot; ]; then<br>  echo &quot;&quot;<br>  echo  &quot;${GREEN} SETTING UP RUBY ${NOCOLOR}&quot;;<br><br>  installDependencyWithBrew rbenv<br>  installDependencyWithBrew ruby-build<br>  # install ruby version from .ruby-version, skipping if already installed (-s)<br>  rbenv install -s<br>fi<br><br># Install gems if a Gemfile exists<br>if [ -e &quot;Gemfile&quot; ]; then<br>  echo &quot;&quot;<br>  echo  &quot;${GREEN} INSTALLING GEMS ${NOCOLOR}&quot;;<br><br>  # install bundler gem for ruby dependency management<br>  gem install bundler --no-document || echo &quot;${RED} FAILED TO INSTALL BUNDLER ${NOCOLOR}&quot;;<br>  bundle install || echo &quot;${RED} FAILED TO INSTALL BUNDLE ${NOCOLOR}&quot;;<br>fi</pre><h4>Glossary</h4><ul><li><strong>.ruby-version:</strong> a simple file that defines, what version of ruby you want to use for the project</li><li><strong>bash:</strong> The default shell for most Linux and UNIX systems, see <a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)">BASH</a></li><li><strong>bundler:</strong> the ruby dependency manager</li><li><strong>gem:</strong> a ruby dependency</li><li><strong>Gemfile:</strong> the definition file, where all the dependencies are listed that bundler should install</li><li><strong>Gemfile.lock:</strong> the file, where bundler saves the exact versions of all dependencies and their dependencies, as resolved during install</li><li><strong>oh-my-zsh:</strong> a collection of configurations and scripts for zsh</li><li><strong>rbenv:</strong> a tool to manage multiple versions of ruby on the same computer</li><li><strong>ruby-build:</strong> a tool to install ruby versions</li><li><strong>ruby:</strong> a <a href="https://en.wikipedia.org/wiki/Ruby_(programming_language">programming language</a></li><li><strong>zsh:</strong> the <a href="https://en.wikipedia.org/wiki/Z_shell">Z Shell</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d3fe078d5e6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/number42de/better-ios-projects-advanced-usages-of-rbenv-9d3fe078d5e6">Better iOS Projects: Advanced Usages of rbenv</a> was originally published in <a href="https://medium.com/number42de">Number42</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Better iOS projects: How to manage the ruby environment of your iOS project using rbenv]]></title>
            <link>https://medium.com/number42de/ios-projects-done-right-how-to-manage-the-ruby-environment-of-your-ios-project-using-rbenv-fafac4f32d3f?source=rss-17a64b696cbc------2</link>
            <guid isPermaLink="false">https://medium.com/p/fafac4f32d3f</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[fastlane]]></category>
            <dc:creator><![CDATA[Wolfgang Lutz]]></dc:creator>
            <pubDate>Tue, 22 May 2018 11:32:59 GMT</pubDate>
            <atom:updated>2018-05-22T19:32:39.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yOB1TnoGg05zyZDJxcY3w.jpeg" /><figcaption>Managing rubies is easier with rbenv.</figcaption></figure><p>In the series “Better iOS projects”, we have a look at the various tools and environments that are useful to have a more convenient and efficient handling of iOS projects.</p><h3>Special Note</h3><p>You should not have to use root user permissions via <em>sudo</em> for any of the installs that follow. If you seem to need to, you most likely already had a permission problem before or you did not install and setup <em>rbenv</em> correctly.</p><h3>How to manage the ruby environment of your iOS project using rbenv</h3><h4>Why do we want to do this?</h4><p><em>ruby</em> has been used to program and run a variety of iOS development tools, such as <a href="https://fastlane.tools/"><em>fastlane</em></a>, <a href="https://cocoapods.org/"><em>cocoapods</em></a> or <a href="https://github.com/CocoaPods/Xcodeproj"><em>xcodeproj</em></a>.</p><p>macOS comes with an older version of <em>ruby</em> preinstalled by default.</p><p>As the system uses <em>ruby</em> itself, it is best practice not to mess around with the system ruby and use a user-installed (and more up-to-date) version of the ruby language.</p><p>A ruby version manager allows you to maintain multiple installs of different ruby versions at the same time and decide per project (automatically via the <em>.ruby-version</em> file) which version of ruby you want to use.</p><p>A glossary of tools and filenames used in this article is available at the end of this article.</p><h4>Which ruby environment manager should I use?</h4><p>We have a smooth experience using <a href="https://github.com/rbenv/rbenv">rbenv</a>, but you should be able to get similar results using <a href="https://rvm.io/">rvm</a> or <a href="https://github.com/postmodern/chruby">chruby</a>.</p><h3>Install and setup rbenv</h3><h4>install brew</h4><p><em>rbenv</em> can easily be installed using the <a href="https://brew.sh/">brew</a> package manager, so make sure you have it installed and running.</p><h4>install rbenv and ruby-build using brew</h4><p>Install <em>rbenv</em> (for managing <em>ruby</em> environments) by running</p><pre>brew install rbenv</pre><p>This will also install <em>ruby-build</em> tool (for installing versions of <em>ruby</em> via <em>rbenv</em>).</p><p>If you are upgrading, run</p><pre>brew upgrade rbenv ruby-build</pre><h4>setup rbenv for your shell</h4><p>After installing the tools above, you need to add a call to setup <em>rbenv</em> to your shell’s configuration script.</p><p>You can find out which shell you are using by calling</p><pre>echo $0</pre><p>Depending on the result, you need to either change <em>~/.bash_profile</em> (for bash), <em>~/.zshrc</em> (for zsh) or the corresponding file of your shell if you have another shell.</p><p>If the file (e.g. <em>~/.bash_profile</em>) does not exist before, just create it.</p><p>As we use the very good <a href="http://ohmyz.sh/">Oh-My-ZSH</a> as shell, we can edit it by opening <em>~/.zshrc</em> in a graphical text editor or edit it directly in the shell by calling</p><pre>nano ~/.zshrc</pre><p>Add</p><pre>eval &quot;$(rbenv init -)&quot;</pre><p>to the end of the file and save it, then quit your terminal application and reopen it to make sure the changes are applied.</p><h3>rbenv commands</h3><p>rbenv has various commands, which should be listed when you run</p><pre>rbenv help</pre><p>The most important for us in the scope of this article are:</p><h4>rbenv version</h4><p>This shows the current ruby version set via <em>rbenv</em>. By default, this should show <em>system</em>. It also shows you the path to the file that is responsible for selecting the version.</p><h4>rbenv versions</h4><p>This lists all versions of ruby installed via rbenv (and the system version).</p><h4>rbenv install</h4><p>Installs a specific version of ruby.</p><p>You can look up the newest version of ruby at <a href="https://www.ruby-lang.org/en/">ruby-lang.org</a>.</p><p>Also, rbenv install -l shows you a list of versions available to <em>ruby-build</em>. If you are missing a version, upgrade <em>ruby-build</em> by running brew upgrade rbenv ruby-build.</p><h4>rbenv local</h4><p>This shows or sets the version defined for the current directory and its subdirectories.</p><h4>rbenv rehash</h4><p>This can become handy if you have trouble using a gem after having it installed, as it updates the underpinnings of rbenv.</p><h4>Debugging</h4><p><em>rbenv which</em> and <em>rbenv whence</em> are useful if you have issues when using ruby via <em>rbenv</em> and something does not work as expected.</p><h3>Install a custom ruby and create the .ruby-version file</h3><p>Start by installing the newest version, which is 2.5.1 at the time of this post:</p><pre>rbenv install 2.5.1</pre><p>See <a href="https://www.ruby-lang.org/en/downloads/">https://www.ruby-lang.org/en/downloads/</a> for the most recent version.</p><p>If there already is a <em>.ruby-version</em> file, run</p><pre>rbenv install</pre><p>without any version argument to install the version set in the <em>.ruby-version</em> file.</p><p>Enter your iOS project directory and run</p><pre>rbenv local 2.5.1</pre><p>to create a <em>.ruby-version</em> file with the content 2.5.1.</p><p><em>rbenv local</em> will only do this, if the version is already installed.</p><p>After restarting the terminal (or entering the parent directory and reentering the directory), running rbenv version should give you the version 2.5.1 if everything worked correctly.</p><h3>How to use Bundler</h3><h4>What is Bundler?</h4><p><em>bundler</em> is a dependency manager for <em>ruby</em>, as <em>cocoapods</em> is for the iOS ecosystem.</p><p>It can ensure that a defined set of dependencies is installed with the exact version of dependencies (gems) that was used when the dependencies where updated the last time.</p><h4>How to install bundler</h4><p>For every ruby version installed via rbenv, you have to once run</p><pre>gem install bundler</pre><p>to install the dependency manager.</p><h4>What files does Bundler use?</h4><p>Bundler defines dependencies using a <em>Gemfile</em>.</p><p>This defines, what <em>gems</em> (and possibly: what versions) you <strong>want</strong> to have installed:</p><pre># List of gems used in this project<br>gem &quot;cocoapods&quot;, &quot;~&gt; 1.5&quot;</pre><p>When updating gems (or adding them to the project), the exact version of the gem that <strong>will</strong> be installed is written to a file named <em>Gemfile.lock</em>.</p><h4>Adding and updating gems</h4><p>When you do not have a <em>Gemfile</em> yet, you can create one by running</p><pre>bundle init</pre><p>To add a first dependency, you can run bundle add &lt;Gemname&gt;, e.g.</p><pre>bundle add fastlane</pre><p>This adds the dependency to the Gemfile and installs the new dependency.</p><p>Running</p><pre>bundle install</pre><p>resolves the dependency graph in the <em>Gemfile</em>, installs the dependencies and writes the resolved versions to the <em>Gemfile.lock</em> file. This is important if you edit the <em>Gemfile</em> by hand.</p><p>You should now be able to run</p><pre>bundle exec fastlane</pre><p>if everything went right.</p><p>To sync the dependencies across the developers of the project, it is important to commit both <em>Gemfile</em> and <em>Gemfile.lock</em> to your project.</p><h4>When do I need to run bundle install and bundle update?</h4><p>Generally, you only need to run bundle update if you really intend to upgrade the versions of your gems.</p><p>When you check out a project and want to get it to build, it is sufficient to run bundle install most of the time.</p><h3>Where to go from here?</h3><p>Install and properly manage the gems your project needs and at least teach your team how to install new ruby versions via <em>rbenv</em> and gems via <em>bundle</em>.</p><p>In the next post of the “Better iOS projects” series, we will have a look at some advanced features of rbenv. Stay tuned!</p><h3>Glossary</h3><ul><li><strong>.ruby-version:</strong> a simple file that defines, what version of ruby you want to use for the project</li><li><strong>bash:</strong> The default shell for most Linux and UNIX systems, see <a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)">BASH</a></li><li><strong>bundler:</strong> the ruby dependency manager</li><li><strong>gem:</strong> a ruby dependency</li><li><strong>Gemfile:</strong> the definition file, where all the dependencies are listed that bundler should install</li><li><strong>Gemfile.lock:</strong> the file, where bundler saves the exact versions of all dependencies and their dependencies, as resolved during install</li><li><strong>oh-my-zsh:</strong> a collection of configurations and scripts for zsh</li><li><strong>rbenv:</strong> a tool to manage multiple versions of ruby on the same computer</li><li><strong>ruby-build:</strong> a tool to install ruby versions</li><li><strong>ruby:</strong> a <a href="https://en.wikipedia.org/wiki/Ruby_(programming_language)">programming language</a></li><li><strong>zsh:</strong> the <a href="https://en.wikipedia.org/wiki/Z_shell">Z Shell</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fafac4f32d3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/number42de/ios-projects-done-right-how-to-manage-the-ruby-environment-of-your-ios-project-using-rbenv-fafac4f32d3f">Better iOS projects: How to manage the ruby environment of your iOS project using rbenv</a> was originally published in <a href="https://medium.com/number42de">Number42</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>