"bundle exec rake" 不尊重 "without"
"bundle exec rake" doesn't honor "without"
在从源代码安装 GitLab 时,我遇到 运行 二进制文件问题,例如 rake
。我自己的 Ruby 或 Rails 项目从未见过类似的问题:
# 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
gem 不见了,毕竟它在 "development" 和 "test" 组中,我已经排除了 "without".
知道这里发生了什么吗?
想出来了,有点愚蠢的原因:RAILS_ENV 应该是自动设置的,但它不是,所以当然会出错。
在从源代码安装 GitLab 时,我遇到 运行 二进制文件问题,例如 rake
。我自己的 Ruby 或 Rails 项目从未见过类似的问题:
# 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
gem 不见了,毕竟它在 "development" 和 "test" 组中,我已经排除了 "without".
知道这里发生了什么吗?
想出来了,有点愚蠢的原因:RAILS_ENV 应该是自动设置的,但它不是,所以当然会出错。