Upgrading to rails 5.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Upgrading to rails 5.0

João Bordalo
Hi there,

I'm upgrading an app from rails 4.2.7 to 5.0.4.

I have updated the binary files through this command $rails app:update, and so far so good.

However, when i run this command  $rails db:migrate, I get the following error:

rails aborted!
NoMethodError: undefined method `scheduler' 

and the code it points is to this block: (the red is what is causing the error.

if !defined?(Rails::Console) && \
    File.basename($0) != 'rake' && \
    Rails.configuration.scheduler
  scheduler_pid_file = File.join(Rails.root, "tmp", "scheduler.pid").to_s
  Scheduler::start_unless_running scheduler_pid_file
end


I'm using gem 'rufus-scheduler', '~> 3.4.2'

Do you have any idea how to solve this?

Thank you for your time,

João Bordalo

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/32c6d598-b076-42af-9e0f-cc8702b28fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Upgrading to rails 5.0

nynhex
You may want to open this as an issue on the gem’s issue tracker: https://github.com/jmettraux/rufus-scheduler/issues

This is not a Rails problem, but more of a compatibility issue with the gem.


On Jul 25, 2017, at 2:21 PM, João Bordalo <[hidden email]> wrote:

Hi there,

I'm upgrading an app from rails 4.2.7 to 5.0.4.

I have updated the binary files through this command $rails app:update, and so far so good.

However, when i run this command  $rails db:migrate, I get the following error:

rails aborted!
NoMethodError: undefined method `scheduler' 

and the code it points is to this block: (the red is what is causing the error.

if !defined?(Rails::Console) && \
    File.basename($0) != 'rake' && \
    Rails.configuration.scheduler
  scheduler_pid_file = File.join(Rails.root, "tmp", "scheduler.pid").to_s
  Scheduler::start_unless_running scheduler_pid_file
end


I'm using gem 'rufus-scheduler', '~> 3.4.2'

Do you have any idea how to solve this?

Thank you for your time,

João Bordalo

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/32c6d598-b076-42af-9e0f-cc8702b28fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CEE637B9-E362-43B9-A494-6A3EE6259CA5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Upgrading to rails 5.0

João Bordalo
In reply to this post by João Bordalo
Hi, again,

 I forgot to mention that block of code belongs to the file config/initializers/scheduler.rb

Additionally, I tried to put rufus-scheduler to the verson that worked in rails 4.2.7. Still, no effect.

That's highly possible what you said.

Thank you for your help and after I have some development, I will tell

Em terça-feira, 25 de julho de 2017 20:21:35 UTC+1, João Bordalo escreveu:
Hi there,

I'm upgrading an app from rails 4.2.7 to 5.0.4.

I have updated the binary files through this command $rails app:update, and so far so good.

However, when i run this command  $rails db:migrate, I get the following error:

rails aborted!
NoMethodError: undefined method `scheduler' 

and the code it points is to this block: (the red is what is causing the error.

if !defined?(Rails::Console) && \
    File.basename($0) != 'rake' && \
    Rails.configuration.scheduler
  scheduler_pid_file = File.join(Rails.root, "tmp", "scheduler.pid").to_s
  Scheduler::start_unless_running scheduler_pid_file
end


I'm using gem 'rufus-scheduler', '~> 3.4.2'
And I followed this guide to upgrade: <a href="https://hashrocket.com/blog/posts/how-to-upgrade-to-rails-5#3-update-rails-binaries-and-configurations" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhashrocket.com%2Fblog%2Fposts%2Fhow-to-upgrade-to-rails-5%233-update-rails-binaries-and-configurations\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFc-U6QcfpN9Qb8Xh52rqVDK7R9Sg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhashrocket.com%2Fblog%2Fposts%2Fhow-to-upgrade-to-rails-5%233-update-rails-binaries-and-configurations\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFc-U6QcfpN9Qb8Xh52rqVDK7R9Sg&#39;;return true;">https://hashrocket.com/blog/posts/how-to-upgrade-to-rails-5#3-update-rails-binaries-and-configurations

Do you have any idea how to solve this?

Thank you for your time,

João Bordalo

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d1f44315-d115-420a-91ef-4e73c06fe104%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Upgrading to rails 5.0

João Bordalo
In reply to this post by João Bordalo
The problem isn't related to the compatibility.

just replace to:

 Rails.configuration.respond_to?(:scheduler) 

on the line that I pointed


Em terça-feira, 25 de julho de 2017 20:21:35 UTC+1, João Bordalo escreveu:
Hi there,

I'm upgrading an app from rails 4.2.7 to 5.0.4.

I have updated the binary files through this command $rails app:update, and so far so good.

However, when i run this command  $rails db:migrate, I get the following error:

rails aborted!
NoMethodError: undefined method `scheduler' 

and the code it points is to this block: (the red is what is causing the error.

if !defined?(Rails::Console) && \
    File.basename($0) != 'rake' && \
    Rails.configuration.scheduler
  scheduler_pid_file = File.join(Rails.root, "tmp", "scheduler.pid").to_s
  Scheduler::start_unless_running scheduler_pid_file
end


I'm using gem 'rufus-scheduler', '~> 3.4.2'
And I followed this guide to upgrade: <a href="https://hashrocket.com/blog/posts/how-to-upgrade-to-rails-5#3-update-rails-binaries-and-configurations" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhashrocket.com%2Fblog%2Fposts%2Fhow-to-upgrade-to-rails-5%233-update-rails-binaries-and-configurations\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFc-U6QcfpN9Qb8Xh52rqVDK7R9Sg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fhashrocket.com%2Fblog%2Fposts%2Fhow-to-upgrade-to-rails-5%233-update-rails-binaries-and-configurations\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFc-U6QcfpN9Qb8Xh52rqVDK7R9Sg&#39;;return true;">https://hashrocket.com/blog/posts/how-to-upgrade-to-rails-5#3-update-rails-binaries-and-configurations

Do you have any idea how to solve this?

Thank you for your time,

João Bordalo

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2b07e845-229a-4173-8f3a-3b23b29897e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...