title: Bundle install: permission denied
body: <p><strong>Context</strong>:
  Trying to learn rails/ruby.
  used the bitnami ubuntu ruby stack VM (2.1) as development environment. its a preinstalled VM that is detailed <a href="http://wiki.bitnami.com/Infrastructure_Stacks/BitNami_RubyStack" rel="nofollow">here</a>.</p>
  
  <p><strong>Problem</strong>:
  Making a new project:
  <code>rails new tp</code> 
  Which will automatically run bundle install, which fails </p>
  
  <pre><code>Installing sqlite3 (1.3.8) 
  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  
      /opt/bitnami/ruby/bin/ruby extconf.rb --with-sqlite3-dir=/opt/bitnami/sqlite 
  checking for sqlite3.h... yes
  checking for sqlite3_libversion_number() in -lsqlite3... yes
  checking for rb_proc_arity()... yes
  checking for sqlite3_initialize()... yes
  checking for sqlite3_backup_init()... yes
  checking for sqlite3_column_database_name()... no
  checking for sqlite3_enable_load_extension()... yes
  checking for sqlite3_load_extension()... yes
  checking for sqlite3_open_v2()... yes
  checking for sqlite3_prepare_v2()... yes
  checking for sqlite3_int64 in sqlite3.h... yes
  checking for sqlite3_uint64 in sqlite3.h... yes
  creating Makefile
  
  make "DESTDIR="
  compiling database.c
  compiling backup.c
  compiling sqlite3.c
  compiling statement.c
  compiling exception.c
  linking shared-object sqlite3/sqlite3_native.so
  
  make "DESTDIR=" install
  /bin/mkdir: cannot create directory `/opt/bitnami/ruby/lib/ruby/site_ruby/2.1.0/x86_64-linux/sqlite3': Permission denied
  make: *** [.RUBYARCHDIR.-.sqlite3.time] Error 1
  
  
  Gem files will remain installed in /home/bitnami/.bundler/tmp/3622/gems/sqlite3-1.3.8 for inspection.
  Results logged to /home/bitnami/.bundler/tmp/3622/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
  An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
  Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
  </code></pre>
  
  <p>Of course it fails with a permission denied because those gems are in directories managed by <em>root</em> and as the developer I create files and do my stuff as the regular <em>bitnami</em> user, of course. That includes using the rails program and using said program through an IDE.
  These assumptions seem clearly at odds with how the rubystack is set up or supposed to be used.</p>
  
  <p><strong>Questions</strong>:<br/>
  -If my methods differ from the methods assumed by the stack, then what IS the assumed method?<br/>
  -If they dont differ, why is making a new project doing administration stuff?<br/>
  -How should I go about making this thing work at all?</p>