title: Riod-iOS Error: You don't have write permissions "Gem::FilePermissionError"
body: <p>I have downloaded a <a href="https://github.com/vector-im/riot-ios" rel="nofollow noreferrer">Riot-iOS</a> and follow a build instructions.</p>
  
  <p>When I run '<em>$ bundle install</em>'</p>
  
  <blockquote>
    <p>Traceback (most recent call last):    2: from /usr/bin/bundle:23:in
    <code>&lt;main&gt;'  1: from
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in
    </code>activate_bin_path'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in
    <code>find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your
    /Users/premkumar/Downloads/riot-ios-develop/Gemfile.lock.
    (Gem::GemNotFoundException) To update to the latest version installed
    on your system, run</code>bundle update --bundler<code>. To install the missing
    version, run</code>gem install bundler:2.0.2`</p>
  </blockquote>
  
  <p>After I run a '<em>$ bundle exec pod install</em>'</p>
  
  <blockquote>
    <p>Traceback (most recent call last):    2: from /usr/bin/bundle:23:in
    <code>&lt;main&gt;'  1: from
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in
    </code>activate_bin_path'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in
    <code>find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your
    /Users/premkumar/Downloads/riot-ios-develop/Gemfile.lock.
    (Gem::GemNotFoundException) To update to the latest version installed
    on your system, run</code>bundle update --bundler<code>. To install the missing
    version, run</code>gem install bundler:2.0.2`</p>
  </blockquote>
  
  <p>So, I update a gem by running '<em>$gem update --system</em>'</p>
  
  <blockquote>
    <p>Updating rubygems-update ERROR:  While executing gem ...
    (Gem::FilePermissionError)
        You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/gZG5n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gZG5n.png" alt="enter image description here"></a></p>
  
  <p>Kindly help me.</p>