I have wrote a script for issue reminder
cd /var/www/redmine
/usr/local/rvm/gems/ruby-2.2.5/wrappers/rake reminder:exec RAILS_ENV="production
But while running the above script getting error
/usr/local/rvm/gems/ruby-2.2.5/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
rake aborted!
Don't know how to build task 'reminder:exec' (see --tasks)
/usr/local/rvm/gems/ruby-2.2.5/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.2.5/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
The rake task seems to be added by the redmine_mail_reminder plugin. Since the task can not be found apparently, you probably don't have this plugin installed properly (or at all).
It is also possible that you are not in the correct directory. For the rake task to work, you have to change to the root directory of Redmine, i.e. the directory containing the app, lib and plugins directories as well as the Gemfile.
Finally, Redmine itself can send reminders without the use of plugins with the use of a different rake task which is shipped with Redmine itself:
bundle exec rake redmine:send_reminders days=7 RAILS_ENV="production"
See RedmineReminderEmails for details.
Related
I'm trying to deploy my Rails 4 app using Capistrano 3. I'm getting error messages in running the db:migrations (i've been sloppy, sorry). Is there a way to have Capistrano deploy the app (at least the first time) using db:schema:load?
An excerpt of my deploy.rb:
namespace :deploy do
%w[start stop restart].each do |command|
desc 'Manage Unicorn'
task command do
on roles(:app), in: :sequence, wait: 1 do
execute "/etc/init.d/unicorn_#{fetch(:application)} #{command}"
end
end
end
I'm not sure how to override Capistrano 3's default behaviour. Can someone tell me how to add this to my script?
For first time deploys, I generally hack around it by logging into the server, cding into the release directory (which will have the deployed code at this point), and then manually running RAILS_ENV=yourenv bundle exec rake db:setup.
In Capistrano 3.10.1 with a Rails 5.1.6 application,
~/Documents/p.rails/perla-uy[staging]$ bundle exec cap staging deploy:updating
gives me enough to shell-in and run the db:structure:load or db:schema:load task manually. In the secure shell session to the host, switch to the newly created release directory and:
dclo#localhost:~/perla-uy/releases/20180412133715$ bundle install --without development test --deployment
dclo#localhost:~/perla-uy/releases/20180412133715$ bundle exec rails db:schema:load
Shelling into a (successful or failed) deploy that has tried deploy:migrate isn't quite the same.
Note: I have RAILS_ENV=production and RAILS_MASTER_KEY=... set-up by the shell login.
Loved the previous question at:
500 Internal Server Error - ActionView::Template::Error in Rails Production
I get the same error when browsing the git tree via the web (internal 500), but the answer there said I should run
bundle exec rake assets:precompile
and referred me to
http://guides.rubyonrails.org/asset_pipeline.html#in-production
I am running GitLab 7.6.1 0286222 on Ubuntu 14.04 LTS fully up to date. That allows me to push and pull from local git machines fine and look around via the web service as well. I ran the revised assets:precompile as suggested below, but the problem continues for me.
So as to my specific error. In the production log I get:
git#git01:~/gitlab/log$ tail -n 20 production.log
Started GET "/chef/cheftest/tree/master/cookbooks" for 127.0.0.1 at 2014-12-24 16:03:25 -0500
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"chef/cheftest", "id"=>"master/cookbooks"}
Completed 500 Internal Server Error in 490ms
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
1: - tree, commit = submodule_links(submodule_item)
2: %tr{ class: "tree-item" }
3: %td.tree-item-file-name
4: %i.fa.fa-archive
app/models/repository.rb:162:in `method_missing'
app/models/repository.rb:228:in `submodule_url_for'
app/helpers/submodule_helper.rb:6:in `submodule_links'
app/views/projects/tree/_submodule_item.html.haml:1:in `_app_views_projects_tree__submodule_item_html_haml___742655240099390426_69818877669240'
app/helpers/tree_helper.rb:19:in `render_tree'
app/views/projects/tree/_tree.html.haml:42:in `_app_views_projects_tree__tree_html_haml__47884322835133800_69818822684460'
app/views/projects/tree/show.html.haml:9:in `_app_views_projects_tree_show_html_haml__1575471590709486656_69818822138660'
app/controllers/projects/tree_controller.rb:13:in `show'
I would be happy to run any commands and edit any configuration files as needed, but please let me know where the files are and how to run the commands. Thanks for your help with this.
I created a new RubyMotion project using:
motion create NewMotion
Then I installed related bundles:
bundle install
Now whenever I run the app I'm getting an error:
➜ NewMotion rake
/Users/info/.rvm/gems/ruby-2.0.0-p353/gems/bundler-1.6.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/Library/RubyMotion/lib/motion/project/xcode_config.rb:87:in `xcode_version'
/Library/RubyMotion/lib/motion/project/xcode_config.rb:99:in `validate'
/Library/RubyMotion/lib/motion/project/template/ios/config.rb:85:in `validate'
/Library/RubyMotion/lib/motion/project/config.rb:115:in `setup'
/Library/RubyMotion/lib/motion/project/app.rb:66:in `config'
/Library/RubyMotion/lib/motion/project/template/ios.rb:81:in `block in <top (required)>'
/Users/info/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
/Users/info/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => simulator
(See full trace by running task with --trace)
Please note that I'm using Ruby ruby 2.0.0p353.
Any help would be highly appreciated.
Cheers
Ok seems I got how I solve this problem:
Install Xcode from the developer.apple.com
Point xcode-select to the Xcode Developer Directory
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
I get the following error while trying to run
"cap production unicorn:start"
DEBUG [29ec5890] Command: cd /home/ec2-user/apps/current && ( RAILS_ENV=production BUNDLE_GEMFILE=/home/ec2-user/apps/current/Gemfile ~/.rvm/bin/rvm default do bundle exec unicorn -c /home/ec2-user/apps/current/config/unicorn/production.rb -E deployment -D )
DEBUG [29ec5890] RVM is not a function, selecting rubies with 'rvm use ...' will not work.
DEBUG [29ec5890]
DEBUG [29ec5890] You need to change your terminal emulator preferences to allow login shell.
DEBUG [29ec5890] Sometimes it is required to use `/bin/bash --login` as the command.
DEBUG [29ec5890] Please visit https://rvm.io/integration/gnome-terminal/ for a example.
DEBUG [29ec5890]
DEBUG [29ec5890] master failed to start, check stderr log for details
cap aborted!
bundle stdout: Nothing written
tail -f log/unicorn.log
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/socket_helper.rb:185:in `new_tcp_server'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/socket_helper.rb:165:in `bind_listen'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:242:in `listen'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `block in bind_new_listeners!'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `each'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `bind_new_listeners!'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:138:in `start'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/bin/unicorn:126:in `<top (required)>'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'
What should be configured to start the unicorn in port 80. Thanks in advance
Try following the advice on this response:
In my deploy.rb file, setting this line:
set :bundle_dir, "/usr/local/rvm/gems/ruby-X.X.X-pXXX"
before this line:
require 'bundler/capistrano'
seemed to help bundler know where to install the gems. Not sure why
this is needed. I've never needed it before.
EDIT
On capistrano3, if you are using gem rvm1-capistrano3, you might need to update it, as it is a fixed issue:
bundle update rvm1-capistrano3
Also, you should use the capistrano3 fork of capistrano-unicorn:
Add the library to your Gemfile:
group :development do
gem 'sepastian-capistrano3-unicorn', :require => false
end
... and remove the line
gem 'capistrano3-unicorn'
I am trying to deploy my first rails application to heroku, and unfortunately I am getting an error when running the heroku create command:
# C:\railsprojects\sample_app> heroku create
The system cannot find the path specified.
Creating protected-reaches-1026... done, stack is cedar
http://protected-reaches-1026.herokuapp.com/ | git#heroku.com:protected-reaches-1026.git
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: No such file or directory - git --version (Errno::ENOENT)
Backtrace: C:/Users/paul/.heroku/client/lib/heroku/helpers.rb:103:in ``'
C:/Users/paul/.heroku/client/lib/heroku/helpers.rb:103:in `has_git?'
C:/Users/paul/.heroku/client/lib/heroku/helpers.rb:108:in `git'
C:/Users/paul/.heroku/client/lib/heroku/helpers.rb:156:in `create_git_remote'
C:/Users/paul/.heroku/client/lib/heroku/command/apps.rb:255:in `create'
C:/Users/paul/.heroku/client/lib/heroku/command.rb:206:in `run'
C:/Users/paul/.heroku/client/lib/heroku/cli.rb:28:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Command: heroku create
Version: heroku/toolbelt/2.39.4 (i386-mingw32) ruby/1.9.3
My initial thought is that GIT is not in the path or otherwise cannot be called, but I eliminated that as part of the problem by simply running git --version:
# C:\railsprojects\sample_app> git --version
git version 1.8.3.msysgit.0
So, everything seems to be in order. Anyone else know what could be going wrong?
I am running Windows 7, and the version of the Heroku client is heroku/toolbelt/2.39.4 (i386-mingw32) ruby/1.9.3.
shouldn't you give the name of the application you want to create. Like heroku create application_name. That is what says in this link.