I'm generating documentation with Yard, and all my comments have been written in Spanish. The problem is that the documentation generated by Yard contains � instead of Spanish accents.
I've used "yardoc" command.
I'm using ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] and Rails 3.0.7
Running on Windows 7
Probably your source files are encoded in ISO Latin 1 while Yard expects them to be in UTF-8.
You could instruct Yard to read your files in ISO Latin 1 instead of the default UTF-8, but I strongly suggest you to re-encode your source files as UTF-8 files. Any decent text editor should be able to do that with one or two clicks.
Related
I am upgrading a Rails 6.1.4 application from Ruby 2.6.10 to Ruby 2.7.6. With Ruby 2.7.6, WebMock no longer matches the Regular Expressions that worked perfectly in 2.6.10.
I am using the latest version of the WebMock gem (3.14.0) in both cases, as well as the latest versions of the required gems, for both the Ruby 2.6.10 and the Ruby 2.7.6 implementations.
Comparing the stub_requests created under Ruby 2.6.10 those created under Ruby 2.7.6, I am seeing no differences.
I have looked through the Ruby 2.7 change notes and am not seeing anything that gives me any indication on what changed that could impact.
Originally, I had experienced this problem upgrading to Ruby 3.0.4, but experimented with 2.7.6 and see that this is where the problem appears to be introduced.
Looking through the Gemfile, I am not seeing anything that looks like it could be causing the problem.
When I replace the RegEx text with hard-coded values, the stubs are found, but this kinda kills the flexibility of using RegEx.
Any suggestions on where I could look to find out why RegEx is no longer working?
The root cause was that the headers has changed between Ruby 2.6 and 2.7 and I had to update the expected header.
Before judging this question please listen to these details:
I have tried twenty million things to "update" ruby so that it is compatible with ruby on rails. The problem is that I cannot make changes to anything in the bin of my macbook. The terminal simply does not allow it. So, I installed a new version of ruby via the command line that is 2.5.1. How do I direct rails via the terminal to use this version instead of the version in my bin?
From the official Rails Guides website.
Rails 6 requires Ruby 2.4.1 or newer.
Rails 5 requires Ruby 2.2.2 or
newer.
Rails 4 prefers Ruby 2.0 and requires 1.9.3 or newer.
Rails 3.2.x is the last branch to support Ruby 1.8.7.
Rails 3 and above require Ruby 1.8.7 or higher.
While Rails 6 is still unreleased, this is a preliminary guess, given from the current master-branch of the official repository, at https://github.com/rails/rails/blob/master/guides/source/upgrading_ruby_on_rails.md
From edge-guides:
http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#ruby-versions
On ruby 1.8.7 I had no problems with swedish chars ÅÄÖ but now on ruby 1.9.2 this exception comes up. Strangley enough it does not appear on my Ubuntu machine.
Can it be fixed without Magic encoding or putting #encoding utf-8 on top of every ruby file with Swedish chars?
Looks like there is no solution to avoid this Error without adding encoding line
Add "# coding: utf-8" to all files
Hmm, try to add this
export LC_ALL="en_US.UTF-8"
to your ~/.profile, ~/.bash_profile or equivalent. It worked here!
I have a Rails application running on Rails 2.3.9. It runs fine with ruby 1.8.7. I'm testing it with ruby 1.9.2-head right now.
The application loads fine until I try to load a page that relies on a unicode string. Then I get the infamous encoding error:
ActionView::TemplateError (incompatible character encodings: UTF-8 and ASCII-8BIT) …
It looks like the problem is that I'm getting some strings from the database as ASCII-8BIT.
I know Rails 3 works with ruby 1.9 and unicode fine. I wonder if a solution has been backported to 2.3.
So, is there any way to get unicode 2.3.9 rails apps working under ruby 1.9?
So I went ahead and wrote a plugin that fixes the two underlying issues that were causing encoding problems:
ActiveRecord models
Rails built-in helpers
See UnicodeOverride plugin on GitHub.
If you are using mysql, use this instead of the mysql gem http://github.com/tmtm/ruby-mysql . Leave "mysql" as your database adapter in database.yml.
We are running ruby 1.9.2-rc1 with rails 2.3.8 and this solved the incompatible character encoding issue.
Ruby 1.9.1 RC1 was released today so I quickly moved to install it (a test version of course using a suffix of 19). I install Rails and Rack for the 1.9 RubyGems and then create a new Rails site using edge... when I execute:
ruby19 ./script/server
I watch as the processor usage goes up to 99.8 and the terminal just sits there. Trying to run Rails 2.2 using 1.9.1RC1 gives all sorts of fail on the inflector. I was under the impression that Rails 2.2 was 1.9.1 compatible. Is anyone successfully testing Rails under Ruby 1.9.1 or are you seeing similar errors?
The same thing for me.
I'm running the latest edge rails under webrik and just see the blank screen and no response to Ctrl-C. Rails 2.2 isn't working at all.
Also, I've tried run edge under thin (with eventmachine from github fixed to build on ruby 1.9.1, except one broken ruby test - I've just added empty one with 'assert true').
After that, both webrick and thin crashes immediately with:
$ /usr/local/bin/ruby script/server
/usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.3/lib/rubyeventmachine.bundle: [BUG] Bus Error
ruby 1.9.1 (2008-12-30 patchlevel-0 revision 21203) [i386-darwin9.6.0]
So, I guess, we all need calm down now. There still much work to actually run our rails apps under 1.9.1. Many gems are still at the early stages of bringing compatibility with 1.9.1
Actually, rails 2.2 is not fully compatible with ruby 1.9.1, just a basic compatibility, according to rails core team :)
Full compatibility claimed in upcoming rails 2.3.
I have written a guide on using Rails edge (near enough to 2.3) and Ruby 1.9.1. mysql, postgres and a few other gems like hpricot, thin and mongrel don't work, but the application does work.
Rails 2.2.2 is not compatible with Ruby 1.9.1rc1 when processing characters and strings on ActiveSupport. Rails uses multibyte to support unicode char-set, in other hand Ruby 1.9.1 uses built-in unicode support. Supported versions is 1.8.5 to 1.8.7.