title: Building native extensions error in installing ruby gems
body: <p>I installed a ruby version as below</p>
  
  <pre><code>$ rvm install ruby-1.9.3-p448-dev
  </code></pre>
  
  <p>and when i checked version as below</p>
  
  <pre><code>$ ruby -v
  
  ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
  </code></pre>
  
  <p>But when i tried to install travis like below</p>
  
  <pre><code>$ gem install travis
  
  Building native extensions.  This could take a while...
  ERROR:  Error installing travis:
      ERROR: Failed to build gem native extension.
  
      /home/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
  /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `initialize': Permission denied - /home/user/.travis/travis.sh (Errno::EACCES)
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `open'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1371:in `block in copy_file'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1370:in `open'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1370:in `copy_file'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:477:in `copy_file'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:396:in `block in cp'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1529:in `fu_each_src_dest0'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
      from /home/user/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/fileutils.rb:395:in `cp'
      from extconf.rb:5:in `&lt;main&gt;'
  
  
  Gem files will remain installed in /home/user/.rvm/gems/ruby-1.9.3-p448/gems/travis-1.5.2 for inspection.
  Results logged to /home/user/.rvm/gems/ruby-1.9.3-p448/gems/travis-1.5.2/completion/gem_make.out
  </code></pre>
  
  <p>So how to avoid the above <code>native extensions</code> error and install the <code>travis</code> succesfully using <code>gem</code> </p>
  
  <p><strong>Edit</strong></p>
  
  <p>When i tried the command by including <code>sudo</code> as below</p>
  
  <pre><code>sudo gem install travis
  </code></pre>
  
  <p>I am getting the below message as success</p>
  
  <pre><code>Building native extensions.  This could take a while...
  Successfully installed travis-1.5.2
  1 gem installed
  Installing ri documentation for travis-1.5.2...
  Installing RDoc documentation for travis-1.5.2...
  </code></pre>
  
  <p>And now what all i am trying to do is to set up <code>environ</code> variables on <code>travis</code>
  and hence i tried the following command</p>
  
  <pre><code>$ travis encrypt -r travis_uname/app_name EMAIL_HOST_KEY=key_value
  </code></pre>
  
  <p>and getting the below wierd error</p>
  
  <pre><code>/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find travis (&gt;= 0) amongst [addressable-2.3.5, backports-3.3.3, bundler-1.3.5, bundler-unload-1.0.1, coderay-1.0.9, ethon-0.6.0, faraday-0.8.8, faraday_middleware-0.9.0, ffi-1.9.0, gh-0.11.3, highline-1.6.19, launchy-2.3.0, method_source-0.8.2, mime-types-1.24, multi_json-1.7.9, multipart-post-1.2.0, net-http-persistent-2.9, net-http-pipeline-1.0.1, netrc-0.7.7, pry-0.9.12.2, pusher-client-0.3.1, rake-10.1.0, ruby-hmac-0.4.0, rubygems-bundler-1.2.2, rubygems-update-2.0.7, rvm-1.11.3.8, slop-3.4.6, typhoeus-0.6.4, websocket-1.0.7, websocket-native-1.0.0] (Gem::LoadError)
      from /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
      from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in `gem'
      from /usr/local/bin/travis:18
  </code></pre>
  
  <p>So finally how to avoid above error and make the above travis command work successfully ?</p>