2017-07-10 33 views
4

從源代碼安裝GitLab時,運行二進制文件時出現問題,例如rake。我從來沒有見過類似的問題,我自己的Ruby或者Rails項目:「bundle exec rake」不符合「沒有」

# bundle config 
Set for your local app (/mnt/data/www/gitlab.bitcetera.com/source/gitlab/.bundle/config): "1" 

path 
Set for your local app (/mnt/data/www/gitlab.bitcetera.com/source/gitlab/.bundle/config): "vendor/bundle" 

without 
Set for your local app (/mnt/data/www/gitlab.bitcetera.com/source/gitlab/.bundle/config): "development:test:unicorn:mysql:kerberos:metrics" 

disable_shared_gems 
Set for your local app (/mnt/data/www/gitlab.bitcetera.com/source/gitlab/.bundle/config): "true" 

# bundle install --deployment --without development test unicorn mysql kerberos metrics 
# bundle config 
The Gemfile's dependencies are satisfied 

# bundle exec rake --tasks 
rake aborted! 
LoadError: cannot load such file -- haml_lint/rake_task 

望着Gemfile的相關章節:

group :development, :test do 
    [...] 
    gem 'haml_lint', '~> 0.21.0', require: false 
    [...] 
end 

當然的haml_lint寶石丟失,畢竟,這是在「發展」和「測試」小組中,只有我通過「無」排除。

任何想法這裏發生了什麼?

回答

3

想通了,有點尷尬的原因:RAILS_ENV應該已經自動設置,但它不是那樣當然會出現錯誤。

+0

除了應該自動設置「RAILS_ENV」的部分之外,這是有意義的。沒有理由爲什麼'bundle exec'或'rake'會自己設置值;其默認值由['rails server'](https://github.com/rails/rails/blob/111736ddf6fe81f3e42af37dfa1b0520a8c91473/railties/lib/rails/commands/server/server_command.rb#L33-L35)或'軌道控制檯「(類似的實現)。如果你想讓你的rake任務定位到一個環境,那麼這個任務應該實現一個理智的默認值。 – anothermh

相關問題