Deprecation warning when using Compass Rails - ruby-on-rails

I am using the Compass gem for Rails. After installing it, I've used some mixins that come with Compass. I am getting a deprecation warning in the console:
DEPRECATION WARNING on line 87 of /usr/local/rvm/gems/ruby-2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss: #{} interpolation near operators will be simplified
in a future version of Sass. To preserve the current behavior, use quotes:
unquote('"$moz-"#{$experimental-support-for-mozilla} "$webkit-"#{$experimental-support-for-webkit} "$opera-"#{$experimental-support-for-opera} "$microsoft-"#{$experimental-support-for-microsoft} "$khtml-"#{$experimental-support-for-khtml}')
You can use the sass-convert command to automatically fix most cases.
I am having trouble finding a fix for this online. What does this warning mean and what can I do to fix it?

Apparently this is a bug in the gem. Workaround until fix is pushed to gem here: https://github.com/Compass/compass/pull/2088

Related

Add Hotwire to existing Rails 6.1 app using sprockets

I'm trying to upgrade an existing Rails 6.1 with sprockets app to use stimulus. I installed
gem 'importmap-rails'
gem 'hotwire-rails'
The javascript_importmap_tags causes this error in Firefox Developer Tools:
Uncaught TypeError: Error resolving module specifier “application”. Relative module specifiers must start with “./”, “../” or “/”.
Should this work alongside sprockets?
I have importmap-rails (0.7.6), stimulus-rails (0.4.2)
Error can be safely ignored I believe.
Update: I can confirm that this error can safely be ignored, it doesn't cause any issues. Obviously this is not the ideal "solution", hence the downvote I guess, so if anyone knows a better answer and posts it that will be great and I will mark it as the accepted answer.

aws-s3 gem unless defined? ##{:instance_writer=>true}

I am trying to integrate the aws-s3 gem with the latest version of Rails (4.1.0), and when starting the server I receive this error:
aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': ///.rvm/gems/ruby-1.9.3-p385/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: syntax error, unexpected $undefined (SyntaxError) unless defined? ##{:instance_writer=>true}
Has anyone got any ideas?
The bulk of the gem has not been updated for over two years so I am thinking that it may finally be out of date.
In Rails 4.1 the bug is happening because cattr_attribute was removed from Module.
A short look at the issues in github: they say that the project has been abandoned.
This pull request was to fix the issue:
https://github.com/marcel/aws-s3/pull/95
You may want to use one of forks like https://github.com/bartoszkopinski/aws-s3, that fixes the issue, or change the gem to the https://github.com/aws/aws-sdk-ruby.

iconv will be deprecated in the future, use String#encode instead

Am getting the following deprecated warnings with ruby 1.9.3-p125 when i run rspec. But there are no deprecated warnings with ruby 1.9.2.
/gems/ruby-1.9.3-p125#cs/gems/soap4r-1.5.8/lib/xsd/iconvchars
et.rb:9:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
/home/ec2-user/.rvm/gems/ruby-1.9.3-p125#cs/gems/hpricot-0.8.2/lib/hpricot/build
er.rb:2:in `require': /gems/ruby-1.9.3-p125#cs/gems/hpricot-0
.8.2/lib/fast_xs.so: undefined symbol: ruby_digitmap - /gems/
ruby-1.9.3-p125#cs/gems/hpricot-0.8.2/lib/fast_xs.so (LoadError)
What could be the cause here? Can someone please help with this.
There is a proposal for ruby 1.9.3 to move stdlibs to gems. As part of this transition transcoding between different string-encodings will be "gemified", see the Wiki (section: What stdlibs should be gemified?).
Therefore every time iconv is called, the deprecation-notice will be shown, in order to notify devs that future versions of ruby won't use lib/iconv and tell them that (and where) a code modification is necessary to account for these planned changes.
For now this is not problematic, as both iconv and String#encode will be supported in order to give devs time to make the transition. but you should keep in mind, that your code will break in future versions if you don't switch out the deprecated code.
A quick Google search will help you make the transition, e.g. "From Iconv#iconv to String#encode", if necessary. if you don't plan to make that change you should stay away from future versions and be extra careful when updating your env.
The log entry tells you that the problem is generated in the soap4r gem.
It looks like the gem was not updated for a while, version 1.5.8 is from year 2007
So it may also have other problems with ruby 1.9.3.
There is a project that claims to have a ruby-1.9 compatible version:
soap4r-ruby1.9
There are also other soap libraries for ruby, here you see some of them:
ruby-toolbox search for soap
Your problem is actually with hpricot, which apparently isn't compatible with ruby 1.9.3, and is throwing the "undefined symbol: ruby_digitmap" you are seeing here. Here's someone else with the same problem.
Unfortunately, hpricot is no longer maintained, so unless someone picks up the mantle, there probably won't be a fix. Your main options would appear to be to stick with ruby 1.9.2, or find an alternative to hpricot. Most people seem to be using nokogiri for XML and HTML parsing in ruby, but there are certainly other options.
To remove this warning...
go to your .rvm directory and find iconv.c (mine was at ~/.rvm/src/ruby-1.9.3-p125/ext/iconv/iconv.c)
edit that file are remove or comment out the call to warn_deprecated() (should be near the bottom)
from that file's directory, run ruby extconf.rb then make then make install
Should do the trick

how do I go about tracking down DEPRECATION WARNING related to Bundler

I'm pretty new to Rails. I keep seeing these deprecation warnings when I start my app:
DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2.
(called from <top (required)> at D:/dev/AquaticKodiak/config/application.rb:12)
DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2.
(called from <top (required)> at D:/dev/AquaticKodiak/config/application.rb:12)
OK, what's on line 12? This:
Bundler.require(:default, :assets, Rails.env)
Hmm, that's not really narrowing it down. This says to me that one of the gems that's related to my app is using a keyword that will disappear soon. I'd really like to figure out which one. All the gems in my gemfile are using the >= [version] syntax, except the ones that are coming from github. I suspect that the github stuff is causing this, but how do I find out which project it is? Pulling code and searching for the keyword looks like work -- is there an easier way?
The Rails deprecation warning is pretty unhelpful here. It has a complete callstack that could help you find the out of date gem, but is filtering the result to return the first non-framework point in the callstack, in this case application.rb.
To find the offending gem I would grab the full callstack at ActiveSupport::Deprecation.warn, which is defined at line 10 of activesupport/lib/active_support/deprecation/reporting.rb.
If you have Pry installed (recommended) then add a conditional binding at line 11 of reporting.rb:
binding.pry if message =~ /ref is deprecated/
Then inspect caller.
If you post a Gemfile I can take a look for you.

Tracking down and fixing i18n deprecation warnings in rails 3 (cucumber 0.9.3 to blame?)

My cucumber test passes, but leaves this ridiculous stack trace. Just your basic The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead. error message, but how am I to find the culprit in that list?
I never used the {{key}} syntax myself, so some gem I'm using is outdated. Please tell me which one. It's really frustrating to have so much kruft every time I run a test.
I was getting that error with Authlogic and it turned out that the more recent versions of the I18n gem (0.4.x, I think) deprecated the call.
I avoided the problem by "rolling back" my I18n gem to version 0.3.7.
As to which plugin, at a guess this is the key line (line 15 on your gist):
/Library/Ruby/Gems/1.8/gems/responders-0.6.0/lib/responders/flash_responder.rb:115:in `set_flash_message!
Since it is the first one that is after the I18n lines, I suspect it is the one that is calling translate with the deprecated interpolation.
(Update a few minutes later):
Looking at: http://github.com/plataformatec/responders/commits/master, ...it looks like you could just upgrade to responders 0.6.2. Their commit on June 24th seems to address the issue.

Resources