https://github.com/ruby-china/ruby-china
为了方便大家参与 Ruby China 开发,刚刚给项目添加了 Vagrant 配置。现在可以用 Vagrant 搭建开发环境,步骤如下:
安装 VirtualBox:
安装 Vagrant:
然后:
$ vagrant up
$ vagrant ssh
$ cd /vagrant
/vagrant $ ./bin/setup
/vagrant $ rails s -b 0.0.0.0
在浏览器打开 http://localhost:3000 。
PS:第一次运行 vagrant up 会下载系统镜像和安装系统依赖,根据网速不同可能要半小时以上。
不好意思,我在執行這個步驟的時候出現這個問題?
vagrant@ruby-china-dev:/vagrant/bin$ ruby setup
setup:11: odd number list for Hash
red: 31,
^
setup:11: syntax error, unexpected ':', expecting '}'
red: 31,
^
我用 vim 開代碼看還是不知道問題出在哪裡?
請大大開示~ m( _ _ )m
vagrant@ruby-china-dev:/vagrant$ rails s -b 0.0.0.0
=> Booting Puma
=> Rails 5.0.0.beta3 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
=> Memory usage: 156.73 MB
[24430] Puma starting in cluster mode...
[24430] * Version 3.0.2 (ruby 2.3.0-p0), codename: Plethora of Penguin Pinatas
[24430] * Min threads: 8, max threads: 16
[24430] * Environment: development
[24430] * Process workers: 4
[24430] * Preloading application
[24430] * Listening on tcp://0.0.0.0:3000
[24430] * Daemonizing...
Exiting
Exiting
/home/vagrant/.rvm/gems/ruby-2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:362:in `delete': No such file or directory @ unlink_internal - /vagrant/tmp/pids/server.pid (Errno::ENOENT)
from /home/vagrant/.rvm/gems/ruby-2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:362:in `block in write_pid'
这是为啥,rack 已装
/home/vagrant/.rvm/gems/ruby-2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:362:in `delete': No such file or directory @ unlink_internal - /vagrant/tmp/pids/server.pid (Errno::ENOENT)
from /home/vagrant/.rvm/gems/ruby-2.3.0/gems/rack-2.0.0.alpha/lib/rack/server.rb:362:in `block in write_pid'
vagrant@ruby-china-dev:/vagrant$ cd tmp/pids
vagrant@ruby-china-dev:/vagrant/tmp/pids$ ls
vagrant@ruby-china-dev:/vagrant/tmp/pids$
下面没有 server.pid
puma.rb 部分代码如下
app_root = '/home/ruby/www/ruby-china/current'
pidfile "#{app_root}/tmp/pids/puma.pid"
state_path "#{app_root}/tmp/pids/puma.state"
bind "unix:/tmp/unicorn.ruby-china.sock"
现在 homeland 的 vagrant 还维护么?从 github 上下载最新的代码,使用 vagrant up,./bin/setup 后在 db:seed 的时候出现异常
NoMethodError: undefined method match?' for "section_node_updated_at=":String
/vagrant/app/models/cache_version.rb:14:in
rescue in method_missing'
/vagrant/app/models/cache_version.rb:11:in method_missing'
/vagrant/app/models/section.rb:15:in
update_cache_version'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/callbacks.rb:382:in block in make_lambda'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/callbacks.rb:207:in
block in halting_and_conditional'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/callbacks.rb:456:in `block in call'