Comments (4)
It's because of "install" command is linux only command, and linux is defined by ruby platform variable. It could be easy implemented for Mac after detection of this system will be pulled from pull request #64
from thin.
Responding to (yet) unanswered question - I can implement config file for autostart(it will be simple XML file copied to directory, so nothing fancy;) is @macournoyer will accept Mac-detection patch.
from thin.
Well, for the note, I eventually got it to work.
Config file:
DB:~/Sites/rubyapp $ cat config/thin.yml
---
chdir: /Users/denis/Sites/rubyapp
environment: development
address: 0.0.0.0
port: 5000
timeout: 30
log: log/thin/thin.log
pid: tmp/thin/thin.pid
max_conns: 1024
max_persistent_conns: 512
require: []
wait: 30
servers: 1
daemonize: true
shell wrapper:
DB:~/Sites/rubyapp $ cat scripts/thin/thin.sh
#!/bin/sh
#
#
# Init
#
prefix=/opt/local
case $1 in
start ) [ -x /opt/local/bin/thin ] && \
/opt/local/bin/thin start -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
;;
stop ) [ -x /opt/local/bin/thin ] && \
/opt/local/bin/thin stop -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
;;
restart) [ -x /opt/local/bin/thin ] && \
/opt/local/bin/thin restart -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
;;
* ) echo "$0: unknown argument: $1";;
esac
plist file:
DB:~/Sites/rubyapp $ cat scripts/thin/thin.plist
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>local.rubyapp.thin</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/daemondo</string>
<string>--label=rubyapp</string>
<string>--start-cmd</string>
<string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
<string>start</string>
<string>;</string>
<string>--stop-cmd</string>
<string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
<string>stop</string>
<string>;</string>
<string>--restart-cmd</string>
<string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
<string>restart</string>
<string>;</string>
<string>--pid=none</string>
</array>
<key>Debug</key><false/>
<key>Disabled</key><true/>
<key>OnDemand</key><false/>
</dict>
</plist>
Auto-start:
DB:~/Sites/rubyapp $ sudo ln -s scripts/thin/thin.plist /Library/LaunchDaemons/local.rubyapp.thin.plist
DB:~/Sites/rubyapp $ sudo launchctl -v load -w /Library/LaunchDaemons/local.rubyapp.thin.plist
Hope this helps someone...
from thin.
Indeed, didn't work because this command is linux only for now. If you can make a pull request to implement this, I'll merge for sure :)
from thin.
Related Issues (20)
- Cannot start as a service
- Can't start Thin Server using Ruby 2.6 HOT 1
- Unable to install thin gem on macOS 11.0 Big Sur beta HOT 12
- Flaky specs HOT 1
- Fix mac install errors or document in readme HOT 2
- Running thin behind a pipe doesn't show messages HOT 4
- Building native extensions fails HOT 4
- Homepage in gemspec is not accessible HOT 2
- Include rack handler test HOT 1
- When the version 1.8.0 or 2.0.0 is released? HOT 8
- rspec doesn't run after cloning the repository HOT 1
- Not working on Debian / Linux Mint - eventmachine error HOT 1
- Multiple SSL certificates HOT 3
- 0712d603a31d97b9fa8a0260da400da2e4217d60
- Issue
- Support rack 3.0.0 HOT 1
- Support Mac M1 HOT 3
- Consider new release for ruby 3.2 support HOT 5
- Uninitialized constant Thin::Server::Fixnum (NameError) with ruby-3.2.2 HOT 2
- Improper handling of requests containing both `Content-Length` and `Transfer-Encoding` headers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thin.