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!
Related
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.
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)
While trying to install Capistrano, I got an error message that rake was not available. since rake is included with ruby, what do I need to do?
Loading files require extra working memory. Cutting off some features and loading them only when necessary with explicit load command will save memory.
Simple mistake, but I will post the answer in case anyone else has had the same frustration - the version of Ruby I was using, 1.9.3, has a 9.x version of Rake bundled with the Ruby installation; Capistrano 3 requires a 10.x version. I installed Rake 10.4.2; problem solved.
Note: If you install a 2.1.x or later version of Ruby, you will automatically get a 10.x version of Rake.
I'm trying to start a rails application in IntelliJ with the Ruby plugin.
I've imported the application and set up the run configuration as best I can. When I try to run it I get the error:
NoMethodError: undefined method `version_requirements' for #<Gem::Dependency:0x7de21f45>
When looking for an answer I found this page saying that I should do this:
$ gem install rubygems-update -v='1.4.2'
$ gem uninstall rubygems-update -v='1.5.0'
$ update_rubygems
Since it's IntelliJ's ruby plugin that is managing the gems, I assume that I have to change the version of rubygems-update that the plugin is using.
Is this the right approach to take? And if so, can anyone tell me how to go about it?
I tried listing the gems but that gem is not shows so I must not be listing the gems in the right place, but I don't know where to look.
Many thanks :)
IntelliJ IDEA cannot handle it, you will need to install the appropriate rubygems version from the command line.
Note that your current rubygems-update version may be different, verify it with gem list and use the reported version when uninstalling.
I have created a very basic Rails 3.1 app, deployed to a box that runs Ruby 1.8.7 (P334) (I can't easily go to 1.9.2. there unfortunately).
After deploying and running 'bundle install' I tried to run a console:
bundle exec rails console
And I get:
Could not find rack-cache-1.0.3 in any of the sources
and the console does not come up.
It seems that this particular version of rack-cache is listed as a dependency by ActionPack 3.1.0.
Can someone explain to me what I need to do to resolve this, i.e. get bundler to attach this version of rack-cache to the project?
Also I read that bundler stores the project-specific GEMs 'somewhere else', i.e. no longer in the global Ruby GEM path. Is there a default location for this project specific place ?
Oh and I also keep getting heaps of 'invalid gemspec' warnings with Rails 3.1, i.e.:
Invalid gemspec in [/usr/local/lib/ruby/gems/1.8/specifications/rack-cache-1.0.3.gemspec]: invalid date format in specification: "2011-08-27 00:00:00.000000000Z"
Ran into this issue when upgrading my Rails 3.0 app to 3.1.
Edit the /usr/local/lib/ruby/gems/1.8/specifications/rack-cache-1.0.3.gemspec file and set s.date = %q{2011-08-27}. This will fix your problem.