{"id":13668857,"url":"https://github.com/liwei78/rails-practice-code","last_synced_at":"2026-01-10T13:16:12.689Z","repository":{"id":27316185,"uuid":"30790455","full_name":"liwei78/rails-practice-code","owner":"liwei78","description":"《Rails 实践：使用 Rails 4 构建在线网店》代码","archived":false,"fork":false,"pushed_at":"2017-02-19T15:58:42.000Z","size":847,"stargazers_count":70,"open_issues_count":0,"forks_count":54,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-11T05:38:20.163Z","etag":null,"topics":["docker","rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://github.com/liwei78/rails-practice","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nadav-dav/cygwin-guide","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liwei78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-14T07:38:47.000Z","updated_at":"2023-12-31T01:25:08.000Z","dependencies_parsed_at":"2022-08-07T12:16:05.853Z","dependency_job_id":null,"html_url":"https://github.com/liwei78/rails-practice-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwei78%2Frails-practice-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwei78%2Frails-practice-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwei78%2Frails-practice-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwei78%2Frails-practice-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liwei78","download_url":"https://codeload.github.com/liwei78/rails-practice-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251077102,"owners_count":21532607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","rails","ruby","ruby-on-rails"],"created_at":"2024-08-02T08:00:51.003Z","updated_at":"2026-01-10T13:16:12.632Z","avatar_url":"https://github.com/liwei78.png","language":"CSS","readme":"# 代码调试说明\n\n该代码最初编写于2015年初，后来经过各种版本升级和 bug 修复，导致一些代码无法正确运行，现在用了新的办法来调试这些代码，尽量避免在环境调试上浪费太多时间。\n\n## 安装 docker\n\n我的开发环境是 mac + docker，如果你是 windows 作为开发机器，可以和我一样安装 docker，具体的文档在 https://docs.docker.com\n\n## 使用 Ruby 镜像\n\n`docker pull ruby:2.3.3`\n\n## 使用容器\n\n在每一份代码里，我增加了 README.md，里面介绍了如何创建一个运行的容器，通常是：\n\n`docker run -itd -p 3000:3000 --name shop -v \"$PWD\":/data -w /data ruby:2.3.3 bash`\n\n创建容器后，使用 `docker exec -it shop bash` 进入该容器的 bash 环境，调试和运行 Rails 命令。\n\n## 启动服务\n\n`rails s -b 0.0.0.0 -p 3000`\n\n启动时的命令稍微不同，需要增加 -b 参数，-p 参数指定容器开放的端口。这样我们方便调试每个章节涉及的代码，并独立运行在自己的端口上。\n\n## 其他安装方法\n\n当然还可以继续使用 rvm 或者 rbenv，或者直接安装 ruby-2.3.3 进行开发使用。大家请各自尝试。\n\n## 建议\n\n不要在 windows 下直接安装 ruby 进行代码调试，那样会产生很多异常情况。为了节省时间，建议直接使用 ubuntu 或者 linux 的虚拟机。\n\n2017年2月\n","funding_links":[],"categories":["CSS"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliwei78%2Frails-practice-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliwei78%2Frails-practice-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliwei78%2Frails-practice-code/lists"}