I want to replace the string
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib/cucumber.rb
with the string
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib/
on the command line, probably using sed. I can't for the life of me figure out the replacement regex to pass to sed. Or maybe sed isn't even the right tool for the job. Any help would be appreciated.