undefined method `action_mailer' with Ruby 1.9.2 and Rails 3.0.8 - ruby

The full error is:
/Users/me/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.8/lib/rails/railtie/configuration.rb:77:in `method_missing': undefined method `action_mailer' for #<Rails::Application::Configuration:0x00000102f545f8> (NoMethodError)
I've searched several variations of this error and come up empty.
Thanks.

Probably you're requiring only specific parts from rails in you application.rb (i.e., not using require rails/all). Try putting require "rails/all" in there.

i uninstalled rails 3.0.8 files and then reinstalled rails 3.0.8 and that fixed the problem.

Related

Rails `require': cannot load such file -- matrix

after updating to ruby 3.1.2 and Rails 7.0.2.3
getting following error while starting rails application:
`require': cannot load such file -- matrix (LoadError)
what could be the possible solution, thanks in advance.
Matrix was removed from Ruby's standard library in version 3.1. More info: https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
With Ruby 3.1, matrix needs to be explicitly added to the Gemfile. You can add it manually or run something like:
$ bundle add matrix
After it's added to the Gemfile, bundle your application:
$ bundle install
Then your application should continue to behave like it did in previous Ruby versions.
I came onto this issue as well when upgrading Rails 6->7 and Ruby 3.0.0->3.1.2.
For my case the issue was related to Capybara gem. Version 3.35.3 assumed it is installed by default with Ruby.
When I upgraded the Capybara to version 3.37.1 then matrix gem was automatically installed as well and the issue was resolved.
same here, ruby 3.1.2, rails 7.0.4 after adding prawn to gemfile. I had to add gem 'matrix' to gemfile and it works.
Just ran into the same issue after adding rubystats gem for some seed data, also using ruby 3.1.2 and rails 7.0.4.
#siasmj 's fix worked for me.

Problems upgrading Rails 4.0.0 to 4.0.x (4.0.13) - private method `include' called for ActionDispatch::Assertions:Module (NoMethodError)

I could not find a "direct" answer to this anywhere. Since I know there will be many other "Late Upgraders" to the party, I feel I need to get this out.
I had a Rails 4.0.0 app running Ruby 2.0.0-p247. After upgrading to 4.0.13, I ran into this error:
private method `include' called for ActionDispatch::Assertions:Module (NoMethodError)
I received this through rspec and WEBrick.
I found a solution via another issue from layer-ruby: NoMethodError: private method `include' called for #-Class:#-Layer::RelationProxy:0x007fd1f67016e0--
geoffreymm discovered that install Ruby 2.2.0 Fixed the issue.
I installed Ruby 2.2.5, and it did indeed solve the issue for me.

undefined method `execute_script' in page object gem

I have started to get this error when running my tests using the 1.2.2 version of the page object gem
Stacktrace
undefined method `execute_script' for <Selenium::WebDriver::Firefox::Bridge:0x00000003cbdba0> (NoMethodError)
/usr/lib64/ruby/gems/2.2.0/gems/page-object-1.2.2/lib/page-object/platforms/selenium_webdriver/element.rb:146:in `parent'
/usr/lib64/ruby/gems/2.2.0/gems/page-object-1.2.2/lib/page-object/platforms/selenium_webdriver/table_row.rb:30:in `find_index_by_title'
/usr/lib64/ruby/gems/2.2.0/gems/page-object-1.2.2/lib/page-object/platforms/selenium_webdriver/table_row.rb:15:in `[]'
It occurs when trying to get the value from a table using a method such as
left_table_element[rank][column]
NB. This had been previously working for over a year so I wonder if a new issue has been introduced?
Looking at the git blame it does seem like the line of code throwing the error in the element.rb might have been changed recently and maybe caused this regression?
The problem is due a change in Selenium-WebDriver. In version 3.0.0, the Remote::Bridge#executeScript method was renamed to #execute_script.
The Page-Object gem was updated in version 1.2.2 to use the new method. However, the gem dependencies were not updated to reflect the required version - ie Selenium-WebDriver v2.53.4 is still listed as the minimum requirement. It looks like this has already been fixed in the eventual Page-Object v2.0 release.
In the meantime, you can fix the issue by upgrading to Selenium-WebDriver v3 (assuming you do not want to downgrade Page-Object):
gem install selenium-webdriver
To fix this issue just need to update your page-object gem to 1.2.2 version
gem install -v 1.2.2 (for selenium-webdriver 3.x only)

Ruby 2.2.2 - Time zone reference

I just upgraded to Ruby v 2.2.2.
Now, when I start my console, I get this error:
.rvm/gems/ruby-2.2.2/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
Loading development environment (Rails 4.0.2)
I don't know what it means or how to fix it. I don't have a file called time_zone.rb in my application, so I assume its something that is incorporated by reference.
Does anyone know what to do to resolve this?
I see that you are using Rails in your project. You just need to upgrade your Rails version to 4.1.9.
This issue was fixed in these commits:
fix ruby 2.2 warning: circular argument reference
use self.method syntax to resolve circular argument issues
You can upgrade the Rails version in your Gemfile or Gemfile.lock files.
Gemfile
gem "rails", "4.1.9"
Gemfile.lock
rails (4.1.9)
Be sure to run bundle after you make these changes!

Why am I getting a NameError out of the box with rails SimpleRecord?

I installed the simple_record gem to use as an ActiveRecord replacement for my rails app. I followed the instructions from http://sites.appoxy.com/simple_record/ and setup an initializer to include the following:
SimpleRecord.establish_connection(AWS_CONFIG['access_key_id'], AWS_CONFIG['secret_access_key'])
When I fire up the rails server (rails s) with I get the following error:
.../.rvm/gems/ruby-1.9.3-p125/gems/simple_record-2.2.0/lib/simple_record/active_sdb.rb:121:in `establish_connection': uninitialized constant SimpleRecord::ActiveSdb::ActiveSdbConnect::Aws (NameError)
It seems that it is trying to find the class name "SimpleRecord::ActiveSdb::ActiveSdbConnect::Aws" but Aws doesn't existing within that namespace. SimpleRecord does require Aws, but it is separate from SimpleRecord. Why would rails be prepending Aws with the SimpleRecord::... namespace?
I'm fairly new to ruby and rails, so maybe my knowledge of name-spacing is lacking and this is an easy fix, but I've been searching for hours and I can't find any answers to my question.
Ruby version: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Rails version: Rails 3.2.1
SimpleRecord version: 2.2.0
I appreciate the help, but after a couple hours of testing things out, I realized that the issue was a conflict between the simple_record gem and the aws-sdk gem. I was trying to use both separately, but apparently that causes issues.
So, I disabled the aws-sdk gem and everything works as expected.
So reading the error message we can get the following, that in here: active_sdb.rb:121 https://github.com/appoxy/simple_record/blob/master/lib/simple_record/active_sdb.rb#L121
the following method requires aws_access_key_id, aws_secret_access_key and some other params
def establish_connection(aws_access_key_id=nil, aws_secret_access_key=nil, params={})
#connection = Aws::SdbInterface.new(aws_access_key_id, aws_secret_access_key, params)
end
So I suspect that Amazon web services access key/secret access key haven't been set up yet or were set up wrongly.
You might want to dig into the code deeper and see where the method was called and what else may cause the problem

Resources