rake

Rails: rake db:migrate *very* slow on Oracle

泄露秘密 提交于 2021-02-19 03:22:32
问题 I'm using rails with the oracleenhanced adaptor to create a new interface for a legacy application. Database migrations work successfully, but take an incredibly long amount of time before rake finishes. The database changes happen pretty quickly (1 or 2 seconds), but the db/schema.db dump takes over an hour to complete. (See example migration below.) It's a relatively large schema (about 150 tables), but I'm sure it shouldn't be taking this long to dump out each table description. Is there

Rails Env Issue

て烟熏妆下的殇ゞ 提交于 2021-02-10 14:24:58
问题 So the other day I was trying to replicate some of the tests that were being ran by circleci and before some of the commands I called: export RAILS_ENV=test export RACK_ENV=test and now I guess the problem is that I seem to be stuck in test ? Also, I've tried executing those same commands except with each of the vars set to development, yet to no avail. Any ideas? 回答1: try 'unsetting' those env variables. export RAILS_ENV= export RACK_ENV= or try restarting the server to set them back to

GitLab备份与恢复

时光怂恿深爱的人放手 提交于 2021-02-09 20:20:24
一、 备份gitlab gitlab的备份比较简单,我们直接使用gitlab本身提供的命令进行备份即可。 1.1 通过gitlab-rake命令备份gitlab gitlab提供的备份命令为gitlab-rake,备份命令使用如下: gitlab-rake gitlab:backup:create 该命令会备份gitlab仓库、数据库、用户、用户组、用户密钥、权限等信息。 备份完成后备份文件会出现在 /var/opt/gitlab/backups/ 当然备份的位置可以更换,使用如下命令: vim /etc/gitlab/gitlab.rb 修改上图 backup_path 的值即可,之后使用 gitlab-ctl reconfigure 使得配置生效 ps:备份文件的名称中1537261122_2018_09_18_9.2.5是此次备份的编号。该编号我们会在后续恢复gitlab数据使用到。 1.2 定时备份gitlab 如果要使gitlab自动进行备份的话,我们可以通过crontab命令来实现自动备份。强烈建议使用系统crontab命令,而不是用户crontab。 以实现每天凌晨4点进行一次自动备份为例,系统的crontab配置如下: vim /etc/crontab 0 4 * * * root /opt/gitlab/bin/gitlab-rake gitlab:backup

Automate a rake task to run on boot on heroku?

倖福魔咒の 提交于 2021-02-05 09:00:09
问题 Suppose there's a task rake startupscript that should run whenever the app boots, how can we automate that on heroku? I know there's a heroku scheduler but that will run the task every 10 minutes instead of just once at boot. I also know of the Procfile and believe this can be a solution, although I do not yet know how to implement (and probably more importantly, I don't want to risk breaking anything else that can be configured via a Procfile, e.g. webserver etc). A lot of the Procfile docs

Automate a rake task to run on boot on heroku?

ぐ巨炮叔叔 提交于 2021-02-05 08:59:49
问题 Suppose there's a task rake startupscript that should run whenever the app boots, how can we automate that on heroku? I know there's a heroku scheduler but that will run the task every 10 minutes instead of just once at boot. I also know of the Procfile and believe this can be a solution, although I do not yet know how to implement (and probably more importantly, I don't want to risk breaking anything else that can be configured via a Procfile, e.g. webserver etc). A lot of the Procfile docs

How to check if rake task was finished?

岁酱吖の 提交于 2021-01-28 09:24:11
问题 This is my first experience with RoR and I using the rspec tool to test my controller. But inside the methods, I using rake tasks to create asynchronous solutions like this: def scan_all_urls system 'rake scan_all_urls &' end And my rake task is this: task :scan_all_urls => :environment do crawler = Crawler.new urls = Url.all crawler.scan_urls(urls) end But my issue is, at the rspec test: it 'should scan all url' do params = {} get 'scan_all_urls', params: params, format: :json end How I

What is the difference between Rails.cache.clear and rake tmp:cache:clear?

梦想的初衷 提交于 2020-11-30 02:45:28
问题 Are the two commands equivalent? If not, what's the difference? 回答1: The rake task only clears out files that are stored on the filesystem in "#{Rails.root}/tmp/cache" . Here's the code for that task. namespace :cache do # desc "Clears all files and directories in tmp/cache" task :clear do FileUtils.rm_rf(Dir['tmp/cache/[^.]*']) end end https://github.com/rails/rails/blob/ef5d85709d346e55827e88f53430a2cbe1e5fb9e/railties/lib/rails/tasks/tmp.rake#L25-L30 Rails.cache.clear will do different

What is the difference between Rails.cache.clear and rake tmp:cache:clear?

若如初见. 提交于 2020-11-30 02:45:08
问题 Are the two commands equivalent? If not, what's the difference? 回答1: The rake task only clears out files that are stored on the filesystem in "#{Rails.root}/tmp/cache" . Here's the code for that task. namespace :cache do # desc "Clears all files and directories in tmp/cache" task :clear do FileUtils.rm_rf(Dir['tmp/cache/[^.]*']) end end https://github.com/rails/rails/blob/ef5d85709d346e55827e88f53430a2cbe1e5fb9e/railties/lib/rails/tasks/tmp.rake#L25-L30 Rails.cache.clear will do different

What is the difference between Rails.cache.clear and rake tmp:cache:clear?

喜夏-厌秋 提交于 2020-11-30 02:44:59
问题 Are the two commands equivalent? If not, what's the difference? 回答1: The rake task only clears out files that are stored on the filesystem in "#{Rails.root}/tmp/cache" . Here's the code for that task. namespace :cache do # desc "Clears all files and directories in tmp/cache" task :clear do FileUtils.rm_rf(Dir['tmp/cache/[^.]*']) end end https://github.com/rails/rails/blob/ef5d85709d346e55827e88f53430a2cbe1e5fb9e/railties/lib/rails/tasks/tmp.rake#L25-L30 Rails.cache.clear will do different

Redmine 项目管理工具

旧街凉风 提交于 2020-11-22 17:25:28
摘要: 此篇博客涉及 安装,插件修改,插件安装,代码显示,中文乱码,SVN配置等内容,几乎覆盖所有redmine基本功能。 本机环境: Redmine 版本: 3.2.0 本机环境: win7 64位 (32位没有影响) SVN:最新的都行,不影响。 Code review 0.7.0 支持redmine 3.0.0 (本机安装的redmine 也支持) 1、什么是redmine: 它是基于ROR框架开发的一套跨平台项目管理系统,底层由ruby+mysql+php写的。 此系统是web端应用程序,CS架构,通过网页的形式与客户进行交互。 2、安装 安装这块比较烦人,有手动安装也有一键式安装,这里推荐一键式安装,安装方式见下面链接。 参考资料: http://blog.csdn.net/benkaoya/article/details/8762935 bitNavi 一键安装redmine 3、新建版本库 选择subversion, 简称SVN。我们在安装的时候,里面已经集成了SVN和git,安装的时候可以选择自己电脑里面有的进行配置。 有一个小地方需要注意: 将本机SVN服务器的server port 端口从原来的443改成8443,这是因为在安装redmine的时候里面集成的SVN的http端口号就是443. 一个IP下,端口不可重复,将VisualSVN Server