redmine migrated to an onther debian9 - ruby

i migrated my redmine from ubuntu server
to an debia server
so i moved the /usr/share/redmine folder,
the /var/cache/redmine folder,
the /etc/redmine folder,
the /etc/apache2/sites-availble folder
and i did the apache vhost things
but i got this error when i try access to redmine:
Started GET "/login?back_url=https%3A%2F%2Fmaster.evey.live%2F" for 197.244.16.191 at 2022-07-13 16:54:46 +0000
Processing by AccountController#login as HTML
Parameters: {"back_url"=>"https://master.evey.live/"}
Current user: anonymous
Rendering account/login.html.erb within layouts/base
Rendered account/login.html.erb within layouts/base (30.3ms)
Completed 500 Internal Server Error in 190ms (ActiveRecord: 35.8ms)
ActionView::Template::Error (unknown keywords: permitted_classes, aliases):
11: <%= favicon %>
12: <%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %>
13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
14: <%= javascript_heads %>
15: <%= heads_for_theme %>
16: <%= call_hook :view_layouts_base_html_head %>
17: <!-- page specific tags -->
app/models/user_preference.rb:50:in `initialize'
app/models/user.rb:952:in `pref'
app/helpers/application_helper.rb:1493:in `javascript_heads'
app/views/layouts/base.html.erb:14:in `_app_views_layouts_base_html_erb__1784490353953904667_47324072699360'
lib/redmine/sudo_mode.
rb:63:in `sudo_mode'

Related

Middleman shows syntax error when using a link_to block

I'm using Middleman 4.2 with Middleman-blog 4.0.2.
When I have:
<% blog.tags.each do |tag, articles| %>
<%= link_to "#{tag.titleize} - #{articles.size}", tag_path(tag) %>
<% end %>
I get the desired <a> element output:
Test Tag - 1
But when I change the link_to to a block:
<% blog.tags.each do |tag, articles| %>
<%= link_to tag_path(tag) do %>
<%= tag.titleize %> - <%= articles.size %>
<% end %>
<% end %>
I get a syntax error:
/source/blog/index.html.erb:43: syntax error, unexpected ')' ...<< ( link_to tag_path(tag) do ).to_s; #_out_buf << '
I can't seem to figure out why I'm not able to get the same output here.
Any pointers?
I just realized I had the wrong erb tag on the line with the link_to helper.
The correct code looks like this:
<% blog.tags.each do |tag, articles| %>
<% link_to tag_path(tag) do %>
<%= tag.titleize %> - <%= articles.size %>
<% end %>
<% end %>

wrong number of arguments (given 3, expected 2) error with forms

I have upgraded my ruby version to ruby 2.6.6p146 and rails version to 4.2.8.
After updating the devise version is 4.6.0 and ransack version is 1.8.10.
Now on run time when I am trying to load my form for user login and it is using devise it is providing me this runtime error
ActionView::Template::Error (wrong number of arguments (given 3, expected 2)):
I am not getting why it is happening and checked my syntax also, here is my form code
<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<h3 class="form-title form-title-first"><i class="icon-lock"></i>Event Admin Account Login</h3>
<div class="form-group">
<label>Username or Email</label>
<%= f.text_field :login, :placeholder => "Username or Email", :class => "form-control" %>
</div>
<div class="form-group">
<label>Password</label>
<%= f.password_field :password, :placeholder => "Password", :class => "form-control" %>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<% if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> Remember me
<% end %>
</label>
</div>
</div>
<%= f.submit "Sign in", :class=> "btn orange btn-lg" %>
<% end %>
I have tried every version of devise and after that I am at the current version, also tried to degrade ransack version, but it didn't help
Here is the stack trace
Started GET "/auction_admin/sign_in" for 127.0.0.1 at 2020-05-02 10:55:11 +0530
Processing by AuctionAdmin::SessionsController#new as HTML
Rendered auction_admin/sessions/new.html.erb within layouts/home (1088.8ms)
Completed 500 Internal Server Error in 1207ms (ActiveRecord: 5.0ms)
ActionView::Template::Error (wrong number of arguments (given 3, expected 2)):
11: <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
app/views/auction_admin/sessions/new.html.erb:11:in `_app_views_auction_admin_sessions_new_html_erb___4037676396427670794_37299260'
app/controllers/auction_admin/sessions_controller.rb:14:in `new'
config/initializers/assets_silencer.rb:7:in `call_with_quiet_assets'
Rendered /home/rails/.rvm/gems/ruby-2.6.6#24f-new-ruby-2.6.6/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_source.erb (17.4ms)
Rendered /home/rails/.rvm/gems/ruby-2.6.6#24f-new-ruby-2.6.6/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (4.4ms)
Rendered /home/rails/.rvm/gems/ruby-2.6.6#24f-new-ruby-2.6.6/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (3.9ms)
Rendered /home/rails/.rvm/gems/ruby-2.6.6#24f-new-ruby-2.6.6/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (39.8ms)

Rails 4 Error: undefined method[]' for nil:NilClass`

I'm trying to setup a messaging system in my site using the Mailboxer gem in Rails 4.
When my app gets to this code:
def fetch_params(key, *subkeys)
params[key].instance_eval do
case subkeys.size
when 0 then self
when 1 then self[subkeys.first]
else subkeys.map{|k| self[k] }
end
end
it returns the error: undefined method '[]' for nil:NilClass
I've tried to figure this out, but I'm not very experienced. I've been following this tutorial: http://jamestansley.com/2014/02/22/customizing-the-mailboxer-ruby-gem-2/
I tried removing the line of code returning the error just to see what would happen, after which I received the error wrong number of arguments (1 for 2..6).
Can anyone attempt to explain this code to me? Been having a really rough time implementing this feature.
view/conversations/_form:
<%= simple_form_for :conversation, url: :conversations do |f| %>
<%= f.input :recipients %>
<%= f.input :subject %>
<%= f.input :body %>
<div class="form-actions">
<%= f.button :submit, class: 'btn-primary' %>
<%= submit_tag 'Cancel', type: :reset, class: 'btn btn-danger' %>
</div>
<% end %>
view/conversations/show:
<h1><%= #conversation.subject %> </h1>
<!--may have to work on this view. don't know if i did the haml conversion correctly-->
<h1> <%= conversation.subject %> </h1>
<ul>
<% content_tag_for(:li, conversation.receipts_for(current_user)) do |receipt| %>
<%= message = receipt.message %>
<h3><%= message.subject %> </h3>
<p><%= message.body %> </p>
</ul>
<% render 'messages/form', conversation: conversation %>
<% end %>
And here's my github repo: https://github.com/portOdin/GoFavorIt-Heroku/blob/8cd19ff5b61eb805dc694a6586f50df608752be2/app/views/conversations/show.erb

rails 3 - I18n::InvalidLocaleData

I am making my website multilanguage using this railscast
But at the very beginning I get an error:
I18n::InvalidLocaleData in Users#index
Showing .../app/views/users/index.html.erb where line #1 raised:
can not load translations from .../config/locales/en.yml, expected it to return a hash, but does not
index.html.erb:
<% provide(:title, t('users.index.title.site_title')) %>
<h1><%= t 'users.index.title.head' %></h1>
<%= form_tag users_path, :method => 'get' do %>
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
<p>
<%= text_field_tag :search, params[:search] %>
<%= submit_tag (t 'users.index.search_form.search'), :name => nil %>
</p>
<% end %>
config/locales/en.yml
en:
users:
index:
title:
site_title: "Users"
head: "Users"
search_form:
search: "Search"
Locale data should be indented two spaces, not four, so correct version is:
en:
users:
index:
title:
site_title: "Users"
head: "Users"
search_form:
search: "Search"
Also, check if you're using spaces or tabs, latter will cause troubles.

devise_invitable routing error

THE ERROR:
Started GET "/users/invitation/new" for 127.0.0.1 at 2013-01-09 01:00:31 +0100
Processing by Devise::InvitationsController#new as HTML
User Load (451.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 3 LIMIT 1
Rendered users/invitations/new.html.erb within layouts/application (69.2ms)
Rendered layouts/_google_analytics.html.erb (0.4ms)
Rendered layouts/_navbar.html.erb (73.6ms)
Completed 500 Internal Server Error in 10785ms
ActionView::Template::Error (No route matches {:controller=>"devise/dashboards", :action=>"show"}):
23: </ul>
24: <ul class="nav pull-right" id="main-menu-right">
25: <% if user_signed_in? %>
26: <li><%= link_to raw("My Agenda"), {:controller => :dashboards, :action => :show}, :tabindex => "-1" %></li>
27: <li><%= link_to raw("My Services"), {:controller => :creative_services, :action => :index_my_services}, :tabindex => "-1" %></li>
28: <li id="fat-menu" class="dropdown">
29: <a href="#" id="dropUser" role="button" class="dropdown-toggle" data-toggle="dropdown">
app/views/layouts/_navbar.html.erb:26:in `_app_views_layouts__navbar_html_erb__952134567516339951_70121556350080'
app/views/layouts/application.html.erb:18:in `_app_views_layouts_application_html_erb___2663940439779075013_70121556359600'
On my Rails 3.1 project, I already use Devise.
I added devise_invitable gem in my Gemfile:
gem "devise", "~> 2.0.0"
gem 'devise_invitable', '~> 1.0.0'
Run these commands
rails generate devise_invitable:install
rails generate devise_invitable User
rake db:migrate
rails generate devise_invitable:views users
Set options in Devise.rb (Unlimited invitations
config.invitation_limit =
and start my server.
When I try to access /users/invitation/new
I am getting a routing error
Routing Error
No route matches {:controller=>"devise/dashboards", :action=>"show"}
In my User model:
devise :invitable, :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable, :invitable
My routes file:
devise_for :users, :controllers => { :registrations => 'registrations' }
How can I fix this routing issue?
workaround found here Routing error with devise {:controller=>"devise/static", :action=>"about"}
Changed my links:
26: <li><%= link_to raw("My Agenda"), {:controller => :dashboards, :action => :show}, :tabindex => "-1" %></li>
27: <li><%= link_to raw("My Services"), {:controller => :creative_services, :action => :index_my_services}, :tabindex => "-1" %></li>
to:
<li><%= link_to raw("My Agenda"), "/dashboards/show", :tabindex => "-1" %></li>
<li><%= link_to raw("My Services"), "/creative_services/index_my_services", :tabindex => "-1" %></li>
"and then all worked fine"

Resources