问题
I was installing gitlab and followed all the instructions of the installation guide of Gitlab. Everything works fine but then at Step "Initialize Database and Activate Advanced Features" it failed!
https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
I got this error Message.
rake aborted!
uninitialized constant Rack::Attack
/home/git/gitlab/config/application.rb:82:in `<class:Application>'
/home/git/gitlab/config/application.rb:13:in `<module:Gitlab>'
/home/git/gitlab/config/application.rb:12:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
In the application.rb file I uncommented the line as it says in the instruction.
# Enable rack attack middleware
# Find and uncomment the line 'config.middleware.use Rack::Attack'
回答1:
Note that, from issue 5245:
Rack Attack is new for 6-2 stable which will be released on 22rd of october.
That being said, read "doc/security/rack_attack.md":
uncomment the line config.middleware.use Rack::Attack
in the config/application.rb find isn't enough.
The other steps are:
- Rename config/initializers/rack_attack.rb.example to
config/initializers/rack_attack.rb
- Review the
paths_to_be_protected
and add any other path you need protecting- Restart GitLab instance
来源:https://stackoverflow.com/questions/19391468/gitlab-rack-attack-insallation