Overriding Calibre's startup directory when stuck on Mac

So, I had a problem tonight with the Calibre ebook software. Essentially, I created a new library for a friend of mine on a USB drive. I then shut down Calibre and ejected the drive for my friend to take with them. The problem came when I went to start Calibre again, and it stalled on startup. i thought something had been corrupted, when I noticed there was an error dialog box underneath the startup image. There error basically said that it couldn't find the library file at the old USB path, and it couldn't create a fresh library at that location because of permissions (the drive wasn't there anymore). After hitting ok on the error message, the application would then terminate.

* There didn't seem to be any way to change preferences at the point in the startup routine where it was getting stuck
* There was no documentation about alternate startup approaches that I could find
* I tried dragging both the library folder and actual database file onto the application, hoping it would recognise the different path.
* I also messed about with a few other random ideas, but nothing really seemed to work

So, what to do?

Finally, I started trying command line approaches. You can't very easily pass a parameter to Mac App (which are actually folders) since you need to use the "open" command on them. A little more searching, and I even found some documentation about command-line parameters at http://manual.calibre-ebook.com/generated/en/cli-index.html

But, nothing about how to use them on a Mac.

So, what you have to do is actually go into the calibre.app folder to /Applications/calibre.app/Contents/MacOS

(First, open Terminal.app. Then type.... )

cd /Applications/calibre.app/Contents/MacOS

Then run

./calibre --with-library=/path/to/your/library

in my case,

./calibre --with-library=/Users/ryan/Calibre\ Library/

It might pop out a warning on the command line, but once the app opens using your correct library then you can close it and open it again normally by opening calibre.app from the Mac Graphical interface.

Hope this helps someone else.... or that calibre implements a fix that makes it easier to choose an alternate library location on startup.

***UPDATE***
It would seem that you should also be able to work around this issue by editing the preferences files (which I couldn't find the location of initially and didn't seem to be documented anywhere in the user manual).

Look in /Users/your-username/Library/Preferences/calibre/global.py

in my case, /Users/ryan/Library/Preferences/calibre/global.py and edit the library_path variable - on a side note, I would imagine the database_path variable is deprecated since it points to a nebulous file name.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><div>
  • Lines and paragraphs break automatically.

More information about formatting options

You can change the default for this field in "Comment follow-up notification settings" on your account edit page.

User login

Navigation