启动 Rails 时启动 Thinking-Sphinx
我正在使用Rails 3和thinking-sphinx,在开发模式下我发现自己必须输入:
rake ts:start
rails s
有没有办法将这些结合起来,因为我总是忘记输入第一个命令,这在开发模式下很烦人。对于生产,我只是使用 capistrano 来启动我的思考狮身人面像,那里没有问题。
I'm using Rails 3 with thinking-sphinx and in development mode I find myself having to type:
rake ts:start
rails s
Is there a way to combine these because I always forget to type the first command and it's just annoying in development mode. For production I just use capistrano to start my thinking-sphinx and there's no problem there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以在命令行中创建别名,然后只需输入 sta 即可。将其放入您的 .profile/.bashrc 文件中(取决于您使用的系统和命令行)
You could also create an alias in your command line then just type
sta
. Put this in your .profile/.bashrc file (depending on what system and command line you're using)创建一个 ruby 文件怎么样,比如
launch.rb
并执行它:
您甚至可以创建一个可执行脚本,如下所述:http://en.wikibooks.org/wiki/Ruby_Programming/Hello_world
What about creating a ruby file, say
launch.rb
and execute it:
You can even create an executable script as explained here: http://en.wikibooks.org/wiki/Ruby_Programming/Hello_world