ryanb/letter_opener — pull request #64 by webdevotion (2013-02-07 17:47:30+00:00)
Title: Launchy::Error: Failure in opening uri

My logs reported that e-mails were being sent as you can expect in development mode.
But the gem didn't open those e-mails in the browser.

I did some research and with some fiddling I got this:

```ruby
# puts uri
uri: /Users/user/projects/rails_app/tmp/letter_opener/1360226029_5a18983/rich.html

# exception thrown after triggering Launchy.open(uri)
09:33:49 web.1 | launchy: # with options {}: Can't convert URI::Generic into String.>
```

I traced the source of this problem back to:
```ruby
# delivery_method#deliver!
Launchy.open(URI.parse(URI.escape(messages.first.filepath)))
```

The tmp files are being generated.

This works for me:
```ruby
# prepend with file://
Launchy.open(URI.parse(URI.escape("file://"+messages.first.filepath)))
```

I installed and configured `envelope_opener` as suggested by the instructions on the homepage.

- `rails 3.2.11`
- `letter_opener 1.0.0`
- `postmark-rails`
- `devise`