有没有一种简单的方法可以在我的计算机上管理许多 Rails 开发站点?
我在 MacBook Pro 上工作。我在 ~/dev 中有很多 Rails 项目。
就像:
- ~/dev/first_project
- ~/dev/second_project
- ~/dev/third_project
- 等等...
有些是rails 2,有些是rails 3,我使用RVM,我的所有项目都使用ruby 1.8.7。
当我为一个项目工作时,我运行“rails s -p 3001”或类似的东西。现在我厌倦了运行命令。我想将 Passenger 与 apache 一起使用,但我不想为每个项目添加配置。
有没有一种方法可以让一种配置适用于所有项目?
例如,first_project.mylocaldomain.com 将与目录中的 ~/dev/first_project 和 .rvmrc 一起使用。等等。所以主机名将决定哪个项目和哪个目录。
我希望我解释得很好。
谢谢。
山姆
I work on my MacBook Pro. I have many rails projects in ~/dev.
It's like:
- ~/dev/first_project
- ~/dev/second_project
- ~/dev/third_project
- and so on...
Some are rails 2 and others are rails 3 and I use RVM and I use ruby 1.8.7 for all my projects.
When I work for a project I run 'rails s -p 3001' or something like that. Now I'm tired of running the command. I want to use passenger with apache but I don't want to add a configuration for each project.
Is there a way that one configuration works for all projects?
For example, first_project.mylocaldomain.com will work with ~/dev/first_project and .rvmrc in the directory. And so on. So the host name will decide which project and which directory.
I hope I explained well.
Thanks.
Sam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
37signals 最近发布了 Pow;这对你来说有什么很酷的吗? (问这个问题是因为我认为可能,但我不确定。)
37signals recently released Pow; does that do anything cool for you? (Asking because I think it might, but I'm not sure.)
尽管 Passenger 是解决此问题的一个很好的解决方案,但您需要为每个站点安装一个
VirtualHost
条目。如果您的配置具有常规结构,那么这并不像听起来那么糟糕。通过一些巧妙的脚本,您可以自动生成所需的文件。一个简单的替代方法是使用乘客首选项窗格来帮助管理你的乘客配置。这避免了必须手动处理各种配置文件。添加新目录分为两步。
37signals 的 Pow 软件是一种新方法,但它会通过重新映射端口来淘汰常规 Apache 实例80. 如果您从事任何其他类型的开发工作,例如 PHP 网站,这可能不适合您。
Although Passenger is a great solution to this problem, you will need to install a
VirtualHost
entry for each site. This isn't as bad as it sounds if you have a regular structure to your configuration. With a bit of clever scripting you can automatically generate the required files.A simple alternative is to use the Passenger Preference Pane to help manage your Passenger configuration. This avoids having to fuss around with various configuration files by hand. Adding a new directory is a two step process.
The Pow software from 37signals is a new kind of approach, but it will knock out your regular Apache instance by re-mapping port 80. If you do any other kind of development work, such as PHP sites, this may not work for you.