https://github.com/amaia/rails-starter-box
使用这个直接就可以创建 Rails 开发环境,还等啥: host $ git clone https://github.com/amaia/rails-starter-box.git host $ cd rails-starter-box host $ git submodule init host $ git submodule update host $ vagrant up
正在 win 下构建当中
ps:项目的 README 文件写错了,clone
回来没cd
到项目路径就运行git submodule update --init
是不对的
D:\rails_vm\rails-starter-box>vagrant ssh
vagrant ssh
isn't available on the Windows platform. You are still able
to SSH into the virtual machine if you get a Windows SSH client (such as
PuTTY). The authentication information is shown below:
Host: 127.0.0.1 Port: 2222 Username: vagrant
1、在用 putty 登陆时 Private key 读取有问题,但通过 putty 登陆时可以直接用用户名:vagrant 密码:vagrant,就能够登陆到 rails-starter-box。可以正常使用了。
2、使用 rails-starter-box 中的 mysql 使用心得: 如果在 rails-starter-box 命令行使用不方便,可以在宿主机使用类似 Navicat 工具连接 mysql. 连接时需要使用 ssh 连接通道进行连接,ssh 连接使用同 1;连接数据库的用户名 vagrant,密码为空。
哈哈 现在可以开始 rails 之旅啦!!加油.....
另,找到 putty 不能读 Private key 的解决办法,vagrant 官网上的说明: http://vagrantup.com/v1/docs/getting-started/ssh.html
Using Microsoft Windows?
An SSH client is generally not distributed with Windows by default. Because of this, if you are on Windows, Vagrant will instead output SSH authentication info which you can use with your favorite SSH client, such as PuTTY.
PuTTY may not recognize the insecure_private_key provided by vagrant as a valid private key. To remedy this, first grab the PuTTYgen app. Then use PuTTYgen and import the insecure_private_key (found in the .vagrant.d dir in your home directory) and save a ppk file from that private key. Use the ppk file instead of the default one when SSHing into your vagrant box.