I have been trying to get rid of these deprecated warnings for 2 weeks now with no luck. Would truly be grateful if someone could point me in the right direction.
First Warning
WARNING: using the built-in Timeout class which is known to have issues when used for opening connections. Install the SystemTimer gem if you want to make sure the Redis client will not hang.
Second Warning
/Users/ChuckJHardy/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:101:Warning: Gem::LoadError#version_requirement= is deprecated and will be removed on or after January 2011. Use #requirement.
Third Warning
/Users/ChuckJHardy/Code/Sites/www/vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
The first error is coming from REDIS. Judging by a quick googling, it's coming when Redis is trying to load the gem system_timer. Try adding that to your gems and see if it resolves.
The second and third error appear to be this problem in rails 2.3.5 and ruby enterprise edition. More information on the lighthouse ticket including a couple of fixes.
For the first one, just install the SystemTimer gem as instructed.
rvmsudo gem install systemtimer
For the next two, upgrade rubygems.
rvmsudo gem update --system
OK, a sideways solution. Place this in your Environments or Initializers file.
ActiveSupport::Deprecation.silenced = true
Related
I recently re-installed my operating system on my work machine, pulled my existing Ruby on Rails project, and received the following error on a certain page of my application:
undefined method `sanitize_sql_array' for #<Property::ActiveRecord_Relation:0x007fb0c1780630>
Did you mean? sanitize_for_mass_assignment
I'm not sure what the issue is being caused by, I cannot find any information on it.
The offending line is apparently count_data = #properties.group_by_month('properties.created_at', format: "%b %Y").size
Where #properties is an ActiveRecord_Relation.
I am running on Rails version 5.1.6.1, and ruby 2.4.1.
The group_by_month method is provided by the groupdate gem
Any ideas on what this issue is caused by?
Please let me know if I can provide any other information.
Update:
I've figured out the problem. I did not install mysql timezone support, which caused the groupdate gem to create an error. The most recent version of the gem fails to notify you in the error to install timezone support like previous versions did.
As said in my orginal post:
I've figured out the problem. I did not install mysql timezone
support, which caused the groupdate gem to create an error. The most
recent version of the gem fails to notify you in the error to install
timezone support like previous versions did.
I am working with Ruby on Rails Tutorial (Third Edition) by Michael Hartl. I am currently in chapter 1 and have been able to download Ruby on Rails-v 4.2.0. I have made all the adjustment within the Gemfile and was successful in connecting to my sever. However, once I closed the server I have not been able to reconnect and get an error message
You cannot specify the same gem twice with different version
requirements. You Specified:sqlite3 (>_0) and sqlite3 (=1.3.9)
I tried to search on Google but did not find the answer. Any help or suggestions would be wonderful!
The error message is saying it all:
You cannot specify the same gem twice with different version requirements. You Specified:sqlite3 (>_0) and sqlite3 (=1.3.9)
You must have mistakenly specified the sqlite3 gem twice in your Gemfile. Remove one of them (possibly the older one), then run:
bundle install
and re-start your rails server.
This should fix your problem.
How do I avoid the circular argument reference warning in activesupport. Happens on ruby 2.2.0
/home/ec2-user/apps/foo_prod/shared/bundle/ruby/2.2.0/gems/activesupport-3.2.21/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
/home/ec2-user/apps/foo_prod/shared/bundle/ruby/2.2.0/gems/ruby-ole-1.2.11.7/lib/ole/types/base.rb:265: warning: duplicated key at line 266 ignored: 4095
Use Rails 3.2.22
gem 'rails', '3.2.22'
OR
warning fixes in version 1.2.11.8:
bundle update ruby-ole
This is an issue of Active Support and has been fixed with these two commits:
https://github.com/rails/rails/commit/8fd52705eda6a2cd7e9a8a5bc723fa094e359eb7
https://github.com/rails/rails/commit/3a30b12c774dfaa72acfe520e823374131631ea9
Unfortunately, these commits have been never included into the 3.2 releases,
because the current last release (v3.2.21) was out on 18 Nov 2014
and after that these commits were merged.
If you don't want to see this warning message definitely, you should change
your Gemfile like this:
# gem 'rails', '3.2.21'
gem 'rails', git: 'https://github.com/rails/rails.git', branch: '3-2-stable'
Otherwise, you should downgrade ruby to 2.1 or wait the release of v3.2.22,
which won't come until a grave security hole is found.
After all, there is no easy way to avoid this issue. Changing Gemfile
for such a trivial annoyance may be an overreaction in my view.
It will delay your deployment process quite a lot.
I was not using compass in my application Based on this post here I upped my Rails version from 4.1.1 to 4.1.9 which worked.
This is compass issue here. They haven't release new version yet so you may need to wait for it.
here is what i did to resolve that, i had the latest ruby and the gems are not compatible with that, so after having a fight for nearly a day i switched to older ruby version using rvm
from ruby-2.2.1 to ruby-2.0.0 ,
again this is not an issue with ruby version but incompatibility with gems,try and have good luck with that.
Well, Here is a solution to this:
Try doing all these changes in your .rbenv/.rvm folder and change in these files:
https://github.com/tmm1/rails/commit/8fd52705eda6a2cd7e9a8a5bc723fa094e359eb7
Hypothetically, updating to Rails 4.2.0 - which you should be able to do via the following commands - should fix this error, although it hasn't worked for me:
rvm use ruby-2.2.0#rails4.2 --create
gem install rails
rails -v
I'm getting the same "circular argument error" message as well (I posted more about my failed attempts to fix it here, will update if I find an answer: Rails gem update not working (version 4.1.1 to 4.2.0) as a solution to "warning: circular argument reference" error).
I altered the time_zone.rb file, instead of now=now, I entered now=Time.now and problem solved.
I ran into the same issue as well, yo can sue the following steps to resolve it (worked for me).
$ gem uninstall compass
$ gem update --system
$ gem install compass
What does this mean? Is my system set for UTF when it should be ASCII or something?
This problem has been nagging me on one of my machines for the past year, and I only solved it just now. The machine in question is an old ASUS laptop running 32-bit Ubuntu 12.04, Ruby 1.9.3, and RVM. I had the same problem running gem update, but only with rake 0.8.7
Sadly, I'm a bit of a newb at this stuff, so I can't quite work it all out, but I ran into two separate issues - inability to update rake beyond 0.8.7, and inability to get the documentation to process correctly. The second problem is the more difficult to understand, but, as I understand it, it results from one particular version of rdoc relying on SourceIndex, which was deprecated in November, 2011.
Both problems are gem-related - character sets in the OS, to name one potential cause, don't seem to be an issue. As best as I can tell, my version of the problem was that my paths weren't correctly set to update the gem program. I'd type "gem update --system" from the prompt and gem would tell me that it was up-to-date, but rake wouldn't update and the characters wouldn't be correctly installed in the documentation for rake, either.
In retrospect, what apparently happened was that the path was set up so that gem update would affect a different version of Ruby than the one I was using under RVM. So, the key is to update the gems you're using by running the update program without having to rely on the path.
The solution has four parts. The first is to uninstall rake.
The second is to update the gems (this also makes it possible to update rake). Usually, this can be done by just typing gem update --system Since I'm using RVM, I did this by going into ~/.rvm/gems/ruby-1.9.3-p194/bin and ran update_rubygems. I suspect that my system fell out of configuration between the path and multiple versions of Ruby. By going directly to the ~/.rvm/gems/ruby-1.9.3-p194/bin directory and running the update_rubygems command,the system was able to update both the correct rdoc gem so it correctly translated the characters, and the correct rake gem, both of which are gems in the rvm-managed version of Ruby.
The third stage is to reinstall rake.
The fourth is the usual suite of testing and hygiene commands - gem clean, gem update, gem list, etc.
I regret not having a better handle on this, but hope this helps.
It causes so many deployment issues it's ridiculous. Most of the time I don't care what version of gems are used, just want to use the latest one.
UPDATE in response to comments:
Here are a couple of examples off the top of my head:
developer A is using a pre-release of a gem so when he runs 'bundle update', the Gemfile.lock is messed up for everyone else and if you deploy it, there goes your site.
A bug in a gem gets fixed so we run gem update across our servers, restart rails and yay, bug fixed! Oh, but wait, it's not fixed? Thanks bundler. What should have been an easy fix is now a full code deploy across our servers.
That's just a couple off the top of my head. At least let us decide if we want to lock in gem versions or perhaps at least allow a range of versions for instance any 2.X version.
UPDATE 2: And yet another issue when there are windows developers on the team
Here is what's showing up in a windows Gemfile.lock:
nokogiri (1.4.4)
nokogiri (1.4.4-x86-mingw32)
Wow, this is just awesome. Sure makes for easy teamwork and deployment.
I recommend starting to use two techniques with your development and deployment:
Specify version number of gems in your gemfile.
For example:
gem "rails", "3.0.1"
gem "will_paginate", "~> 3.0.pre2"
This way, when you decide you want to update rails, or will_paginate, change the version numbers in your gemfile.
Only update certain gems
Rather than the generic bundler update command, run
bundler update rails
This will only update the rails gem to the newest version, rather than get the latest of all gems.
If you use both 1 & 2, you'll have a happier experience.
Then, simply, don't check your Gemfile.lock into source control. All of the specific problems you listed are solved.
Of course, you are sacrificing the enormous advantage that Bundler gives you over any other dependencies management system.