In one of my last projects the tests are breaking after the first fail. Investigating a bit I see this is the expected behaviour when you activate fail fast:
rails test -f
But I am running plane:
rails test
And still the tests are not all executed.
What is making the fail fast to be activate in my project by default? How can I prevent this?
I am pasting my Gemfile.lock here: https://pastebin.com/FD8dEnUE
This is actually a known bug (https://github.com/seattlerb/minitest/issues/730).
A quick and dirty fix is to lock minitest version on your Gemfile:
gem "minitest", "5.10.3"
Since rails 5.0.x is not on maintenance mode anymore (as per https://github.com/rails/rails/pull/32547#issuecomment-380930889) you might need to downgrade minitest version until you are able to upgrade Rails to >= 5.1x
Related
We are using pg_jobs gem for our rails 5 application but now we are trying to upgrade our application with rails 7 ...In that place, we are facing some issues like can't able to bundle the pg_jobs in rails 7 because it's supports the rails 5 only so can't able to run bundle install.
we tried to change the version of pg_jobs gem then also same error we are facing.
This is the error :
**Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 7.0.4)
pg_jobs was resolved to 0.1.0, which depends on
rails (< 6.0, >= 5.1)```
**
The latest version of the pg_jobs gem (as of today) does not even support Ruby on Rails >= 6.0 yet (see Rubygems).
I would consider this gem being abandoned, taking into account that:
only one version of the gem was released ever
the gem does not support any up-to-date Rails version anymore and
the gem's source code didn't get any update in the last 3 years
That means your options are very limited, because it seems unreasonable to expect any updates from the gem's maintainer anymore. And downgrading your application is also not an option because then you were locked to an unsupported Ruby on Rails version.
The only two options I see are:
Fork the gem and update it to Ruby on Rails 7.0 on your own.
Switch to another ActiveJob worker implementation, like Sidekiq.
Forking and taking over maintenance feels like a burden, given that the gem doesn't seem to provide something very special or unique. Therefore, I suggest switching to another gem. Sidekiq is certainly the most popular nowadays, but there are other alternatives like Resque or DelayedJob (see Background Jobs on the Ruby Toolbox) that are worth it being considered depending on your requirements.
Trying to migrate application from Rails-1.1.2 to 2.0.0 to current version.
Basic problem is can't find documentation for it.
I think in Rails 1.1.2 they don't have command to update the application like bundle update rails or rails app:update.
Directly changing ruby version gives boot error.
The first thing you need to do is to upgrade your Rails app to version 1.2.6, which is documented here.
After that you can upgrade to Rails 2.0, which is documented here.
The Rails releases page might be a useful page for you to check out, since they hold the info on how to upgrade. Like you said, there's hardly any information on how to upgrade the older Rails versions, so the official releases page is your best bet.
I'd upgrade to each release individually, so from 1.1.2 to 1.2.0, then to 1.2.6. Then go to 2.0, 2.1, etc. Update your Ruby seperate from it.
You can't directly migrate rails-1.1.x to rails-2.0 due to till Rails 2.3 doesn't have built-in bundler support because it came out before Bundler and no Gemfile in rails also that not a good way to directly update the ruby.
Note: before migrate to any version make sure you have more than 70% test coverage.
Steps help to migrate
Change the rails version (rails 1.1.x to rails 2.0) manually (means in vendor folder).
Run the test case and fix the failing syntax in your code (If any)
Then migrate rails 2.0 to rails 2.higher version (make sure higher than rails 2.3)
Again Run the test case and fix the failing syntax in your code (If any)
Then migrate rails 2.x to rails 3 pre version
Now you can add Gemfile put all gems into that upgrade your bundler gem.
Now you can migrate the ruby version as well.
Again Run the test case and fix the failing syntax in your code (If any)
Then migrate rails 3.0-pre to rails 3.higher version
Again Run the test case and fix the failing syntax in your code (If any)
Then migrate rails 3.x to rails 4 pre version
Now you can migrate the ruby version as well.
This is very long successful process for rails migration if your rails version older that 3.0.
There is one more way to achieve that. If you just want a Gemfile, rather than Bundler integration with Rails, you can create one easily enough.
gem install bundler
bundle init
Then follow below Guide to The Rails Command Line may help you, especially the section that covers rake gems:install.
https://guides.rubyonrails.org/v2.3.11/command_line.html#rake-is-ruby-make
I hope that help you.
Before looking at starting to upgrade an app from such an old version of Rails, I'd suggest reviewing how complicated it is and questioning if it would actually be quicker to build from scratch in the most recent version rather than go through so many upgrades.
In a my previous question (asked about 2 months ago) I was trying to upgrade Ruby on Rails from version 3.2.13 to 4.0.0, without success because the globalize3 ruby-gem compatibility. Today I'm trying again to do the upgrade, without success because the globalize3 ruby-gem compatibility.
I tried all possible solutions that I found on the web (even those that refer to the rails4 branch) but no one works for me: I get error outputs as-like those present in my previous question. However, as you can read here, it seems that someone (lucky, maybe) has solved the compatibility issue. I am not a "lucky" one and, since I aim to use features added by Rails 4 and still use globalize3, I would like to know if there is someone running Rails 4 and the globalize3 with success. If so, what did he / she made to make that?
What is the compatibility status between globalize3 and Rails 4?
Note: I also opened a issue at github.
I'm using it with rails 4 and have no issue.
In my Gemfile:
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
Run bundle update instead of bundle install to resolve all dependencies again. Just lock gems that you don't want updated by indicating a version specifier as explained here http://bundler.io/v1.3/gemfile.html.
I'm running a Rails 2.3.4 app under ruby 1.8.7 and rvm with a custom gemset.
In trying to get rspec up and running, I've tried several times to uninstall rspec 2 and install rspec and rspec-rails version 1.3.4. However, when I run rspec -v I get 2.10.0 regardless of what I do.
Finally I got this error message:
You are running rspec-2, but it seems as though rspec-1 has been loaded as
well. This is likely due to a statement like this somewhere in the specs:
require 'spec'
Please locate that statement, remove it, and try again.
So it looks like 2.10.0 is actually still loaded. Even if I do a gem uninstall rspec rspec is still loaded. What's going on?
You should use spec (the RSpec 1 executable) instead of rspec, as explained in this answer.
I had cucumber 0.6.1 working quite fine... but I ran the gem update cucumber command, and things went smoothly. Then when I decided to run the cucumber features command, I received this error:
Using the default profile...
no such file to load -- cucumber/webrat/element_locator (MissingSourceFile)
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inpolyglot_original_require'
So I tried a few things... I did a gem update on webrat, that didn't work. I removed all previous versions of cucumber by doing gem uninstall cucumber then selecting past versions. Same with webrat. No luck. What am I doing wrong?
Have you tried to regenerate cucumber files with script/generate cucumber --webrat? Maybe it solves it. Just take care not to overwrite features/support/paths.rb.
I resolved this issue. There was an old version of the 'freelancing-god-thinking-sphinx' gem on the server i was deploying to. Removing this gem enabled everything to work properly.
I had a similar issue using Bundler where my Gemfile had >= 0.4.3 version of cucumber, so it would always look to install newer versions of cucumber when updating/installing the bundler gems. Cucumber's env file (/features/support/env), however, referenced files that were not part of the future releases. In particular, '/cucumber/rails/world'. Therefore, I got the same MissingSourceFile error you are getting.
I think either want to roll back your version of cucumber, or update your cucumber env file so it's compatible with your version of cucumber.
For me, I commented out the following line in my env.rb file
# require 'cucumber/webrat/element_locator'
# Deprecated in favor of #tableish - remove this line if you don't
# use #element_at or #table_at
As you can see by the comment following it, it has been depreciated anyway.