chrishunt / desktop

A decent way to change your desktop image
https://github.com/chrishunt/desktop
MIT License
250 stars 15 forks source link

Doesn't work first time on OSX #6

Closed xavriley closed 10 years ago

xavriley commented 10 years ago

Running gem install desktop on OSX 10.8, asked to enter a password to chmod files which all worked fine. Then

[9:01:39] xavierriley:~ $ desktop ~/Dropbox/Environment/Paper_Jet_by_Cher_Tim.png
/Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `initialize': no such table: data (SQLite3::SQLException)
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `new'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `prepare'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:134:in `execute'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/desktop-1.1.0/lib/desktop/osx.rb:62:in `clear_custom_desktop_image'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/desktop-1.1.0/lib/desktop/osx.rb:32:in `desktop_image='
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/desktop-1.1.0/lib/desktop/cli.rb:24:in `set'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/gems/desktop-1.1.0/bin/desktop:9:in `<top (required)>'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/bin/desktop:23:in `load'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/bin/desktop:23:in `<main>'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/bin/ruby_executable_hooks:15:in `eval'
    from /Users/xavierriley/.rvm/gems/ruby-1.9.3-p385/bin/ruby_executable_hooks:15:in `<main>'

Tracked it down to a seemingly redundant SQLite call in lib/desktop/osx.rb. I cloned the repo, deleted that method and removed references to sqlite3 and it works fine now. I'm opening a PR with the changes.

xavriley commented 10 years ago

Sorry I didn't spend enough time reading what was going on. Didn't realise that the sqlite was acting on an OSX file. I'll try to amend the PR after I've figured out whats going on.

chrishunt commented 10 years ago

Ah, thanks. Looks like desktoppicture.db is missing the data table. I wonder if that table is only created after the desktop has been changed manually at least once?

It's also possible that 10.8 manages desktops differently than 10.9. I've only tested on 10.9. Maybe it's time to upgrade? It's free :smile: :tada:

chrishunt commented 10 years ago

This should be fixed in v1.1.1. Please let me know if that works for you or if we need to keep working on this. Thanks!