title: Gitlab project - failed to run "rails generate"
body: <p>Introduction:</p>
  
  <ul>
  <li>I have an installation of gitlab on a local lxc container running ubuntu 13.10 - saucy.</li>
  <li>I have installed RVM as a as a multi-user installation - in <code>/usr/local/rvm</code></li>
  <li><p>In order to run gitlab with RVM I have created a wrapper for the bundle command as specified <a href="https://github.com/gitlabhq/gitlab-public-wiki/wiki/Installing-Gitlab-with-RVM" rel="nofollow noreferrer">here</a></p></li>
  <li><p>The gitlab application is running correctly but I have a problem running <code>rails generate</code> function</p></li>
  </ul>
  
  <p>The steps I followed : </p>
  
  <ul>
  <li><code>$ sudo su git</code> - to login as the git user</li>
  <li><code>$ cd /home/git/gitlab</code> </li>
  <li><code>$ source /etc/profile/</code></li>
  <li><code>$ rvm use gemset ruby-2.1.1@gitlab</code> - a custom gemset I created </li>
  <li><code>$ gem list</code> - lists all the gems that appear in the Gemfile for gitlab, so I know I am on the right gemset</li>
  <li><code>$ rails -v</code> -> Rails 4.0.3</li>
  <li><p><code>$ rails generate --help</code> will output</p>
  
  <pre><code>/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `require': cannot load such file -- rb-inotify (LoadError)
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `each'
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `block in require'
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `each'
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `require'
  from /usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'
  from /home/git/gitlab/config/application.rb:6:in `&lt;top (required)&gt;'
  from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:43:in `require'
  from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:43:in `&lt;top (required)&gt;'
  from bin/rails:8:in `require'
  from bin/rails:8:in `&lt;main&gt;'
  </code></pre></li>
  </ul>
  
  <p>What I gathered from this output is that it is in some way trying to use the <code>ruby-2.1.1@global</code> gemset. </p>
  
  <p>If I switch to that gemset <code>$ rvm use gemset ruby-2.1.1@global</code>, <code>$ gem list</code> will output</p>
  
  <pre><code>*** LOCAL GEMS ***
  
  bigdecimal (1.2.4)
  bundler (1.5.3)
  bundler-unload (1.0.2)
  executable-hooks (1.3.1)
  gem-wrappers (1.2.4)
  io-console (0.4.2)
  json (1.8.1)
  minitest (4.7.5)
  psych (2.0.3)
  rake (10.1.0)
  rdoc (4.1.0)
  rubygems-bundler (1.4.2)
  rvm (1.11.3.9)
  test-unit (2.1.1.0)
  </code></pre>
  
  <p>And if I run bundle install or the wrapper bundle install it says that all the gems are installed.</p>
  
  <p>What am I missing here? </p>
  
  <p>--------------------edit------------------</p>
  
  <p>found a way to make it work </p>
  
  <p>I followed the <a href="https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide" rel="nofollow noreferrer">trouble shooting guide</a> and tried 
  <code>RAILS_ENV=production bundle exec rails generate --help</code> and it worked</p>
  
  <p>Apparently as stated <a href="https://stackoverflow.com/questions/13032580/ruby-gems-with-gitlab-no-such-file-to-load-rb-inotify">here</a> in the last comment, <code>rb-inotify</code> is "marked as development dependency" therefore forcing the environment to be production, it won't try to use it</p>