Comments (9)
@Zhangsm 你列一下 /home/deploy/web/wblog/current 下面是否有文件? 估计还没有链接成功.
from wblog.
@Zhangsm 我这两天更新了 deploy.rb 脚本, 依赖更少了, 还支持了英文博客. 你可以看下.
from wblog.
@windy 按照部署流程,bundle install自后就是建立软链接,再就是Unicorn之类的操作。但mina部署失败之后,他会马上回滚上一步操作,也就是unicorn启动失败后就会删除软链接。
我建立ruby用户,重新部署下看看。
from wblog.
@Zhangsm 嗯, 你如果有需要可以加我 skype, 我可以及时回复你.
from wblog.
@Zhangsm 我 skype 是 lyfi2003
from wblog.
嗯嗯,为了帮助更多的人。我还是把部署中遇到的一些小问题在这里说明吧!!哈哈。。。
首先,非常感谢 @windy 开源这个项目。我列下我遇到的问题吧,不要见怪。。。
1.就是deploy.rb
中:
task :environment do
# queue! %[source /usr/local/rvm/scripts/rvm]
###其实很多人测试环境不一样,这里要注意改动###
queue! %[source /home/#{user}/.rvm/scripts/rvm]
queue! %[rvm use 2.1.2]
end
2.首次部署的时候,bundle install
都会从https://rubygems.org
fetch gem,总会莫名其妙的报些SSL connection rest这样的错误。。。然后mina task终止。。。然后再重新mina deploy -v
有时候有可以。。。反正bundle install
就是没那么轻松。。。哈哈。。。
-----> Installing gem dependencies using Bundler
$ mkdir -p "/home/ruby/wblog/shared/bundle"
$ mkdir -p "./vendor"
$ ln -s "/home/ruby/wblog/shared/bundle" "./vendor/bundle"
$ bundle install --without development:test --path "./vendor/bundle" --deployment
Using rake 10.4.2
Using i18n 0.7.0
3.到启动unicorn的时候,也会报错:
-----> Starting Unicorn...
/home/ruby/wblog/releases/1 not found
-----> Done. Deployed v1
于是,我修改下mina-unicorn
gem包源码,打印该语句出来看看
-----> Starting Unicorn...
/home/ruby/wblog/current
BUNDLE_GEMFILE= RAILS_ENV=production bundle exec unicorn -c /home/ruby/wblog/current/config/unicorn/zh.rb -E production -D
/home/ruby/wblog/releases/2 not found
-----> Done. Deployed v2
发现BUNDLE_GEMFILE读取不到,为空。在unicorn相关配置中找到
before_exec do |server|
ENV["BUNDLE_GEMFILE"] = "#{app_path}/Gemfile"
end
不知道神马原因为空,改成set :bundle_gemfile = "#{app_path}/Gemfile"
会不会好点呢?于是我人肉启动:
BUNDLE_GEMFILE=/home/ruby/wblog/current/Gemfile RAILS_ENV=production bundle exec unicorn -c /home/ruby/wblog/current/config/unicorn/zh.rb -E production -D
启动成功了。于是就产生了/tmp/unicorn_wblog_zh.sock
这个文件。
到这一步,接着配置nginx,应该就没有什么问题了吧。
这是一个优秀的项目,值得去学习!只不过我遇到的问题多了一点。。。。
from wblog.
@Zhangsm bundle 的问题不能怪别人哈, 谁让我们国内的网络封了 rubygems.org 呢...
但也有其他方法, 比如 wblog Gemfile 里其实添加了 RUBY_TAOBAO 的环境变量, 如果你的环境在国内, 就修改一下 deploy.rb
task :environment do
export RUBY_TAOBAO=1
....
end
这样就会用 taobao 的源来 bundle.
unicorn 的问题, 你也可以用 mina uniorn:restart -S
来查看脚本内容.
mina 是个好东西, 第一次布署遇到类似问题很正常, 以后就方便多了.
from wblog.
如果在deploy.rb
中加入这个set :term_mode, nil
就更加妥妥的了。哈哈。。。。
from wblog.
@Zhangsm 这个要看你用的啥终端:) mac 下默认的显示效果非常好.
我把这个 issue 先关了, 为了方便其他人找到这里, 我把链接加到 wiki 里了, 也谢谢你的布署分享 👍
from wblog.
Related Issues (20)
- Could not find activesupport-4.1.9 HOT 4
- cp: config/database.yml.example: No such file or directory HOT 1
- Suggestion for comment reviewing system HOT 2
- Redesign category system HOT 1
- New UI
- New subscribe system
- Update Rails 4.1 to Rails 4.2
- Rewrite wblog with Rails5 technology stack HOT 1
- Refresh comments content when others post new comment
- Update README
- 已删除的post再次访问会进入rails的报错界面 HOT 3
- 以production环境运用网站无法正常显示ui HOT 7
- 拒绝连接,但我的端口并未被占用 HOT 2
- 谢谢
- 配置管理员账户出现问题? HOT 5
- 上传图片的问题 HOT 2
- Add search title feature HOT 1
- n + 1 问题
- 請教一下,因為我有上傳多個檔案和圖片的需求,將CKEditor+Paperclip套件加入了,但發布文章都不會成功! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wblog.