d3-rails provides D3 for Rails 3.1.
d3-rails comes with version 2.9.2 of D3.js.
Add this line to your
Please note that D3 is provided via the asset pipeline and you do not need to copy their files into your application. Rails will get them from d3-rails automatically.
Then add it to your manifest file, most probably at
//= require d3