ZenTest errors preventing autotest from running - ruby-on-rails

I've previously added ZenTest to my gemfile to get autotest to run. On this occasion I get the following error four times over:
saasbook#saasbook:~/Documents/github/LocalSupport$ bundle exec autotest
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/ZenTest-4.9.0.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
I've searched on this error and found a number of discussions in the github repo for ZenTest:
https://github.com/seattlerb/zentest/issues/29
https://github.com/seattlerb/zentest/issues/32
https://github.com/seattlerb/zentest/issues/33
I've followed some of the advice there, uninstalled and re-installing ZenTest, but no joy. I'm on ubuntu running ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
My entire app is available here:
https://github.com/tansaku/LocalSupport
so for example you can check out my GemFile:
https://github.com/tansaku/LocalSupport/blob/master/Gemfile
Any ideas?
Many thanks in advance

Just fixed this by editing
/usr/local/lib/ruby/gems/1.9.1/specifications/ZenTest-4.9.0.gemspec
so that the line specifying the rubygems version is now this:
s.required_rubygems_version = Gem::Requirement.new("< 2.1") if s.respond_to? :required_rubygems_version=
now everything runs fine ...

Upgrading rubygems and reinstalling the ZenTest (according to what Sam wrote) solved my problem but it causes me another problem:
/Users/neo/.rvm/gems/ruby-1.9.2-p320/gems/bundler-1.2.3/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': uninitialized constant Gem::SourceIndex (NameError)
Anything I want to do, from running the autotest to starting rails server, it gives me that error. After searching a bit I found this page.
It seems that the latest version of rubygems has some bugs, so you should not upgrade it to the latest version, instead upgrade it to a stabler version like 1.8.24 .

Related

Setting breakpoints in VS code using Rails

Running into ruby version clash when trying to start the rails debugger inside of VS Code. Sorry if this is a stupid question.. I'm normally a Js guy, very new to Rails
Getting this error :
rake (>= 0.8.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Uncaught exception: Your Ruby version is 2.3.7, but your Gemfile specified 2.3.1
/Library/Ruby/Gems/2.3.0/gems/bundler-1.17.3/lib/bundler/definition.rb:495:in `validate_ruby!'
/Library/Ruby/Gems/2.3.0/gems/bundler-1.17.3/lib/bundler/definition.rb:470:in `validate_runtime!'
.
.
.
When I type ruby --version in my console, I get ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin17]
Had this same issue.
Restarting the computer worked for me.
The vscode debugger console environment doesn't seem to update until a complete computer restart happens. Might be a bug or intentional.

rails uninitialized constant Sprockets::SassCacheStore

I'm new to rails and trying to do some playing around with gems and such.
My case here is that I have this navigation menu on my website and I needed to get the current_page link selected.. rather than building a helper I wanted to install a gem so I went and looked for one and found this one.
I then followed what the documentation said:
In my gemfile I added
gem 'rack_current_page'
Then in the project root config.ru
require ::File.expand_path('../config/environment', __FILE__)
use Rack::CurrentPage
run Rails.application
And finally I ran:
bundle and rails s only to find out I had this error:
uninitialized constant Sprockets::SassCacheStore
The error happens when including the application stylesheet in the layout file.
I'm using the following packages / versions (only listing what might have impact - if I'm missing something let me know)
(<gem> -v)
Rails 4.2.1
Sprockets 3.0.0
Sass 3.4.13
Rack 1.5
While doing the uninstall I removed every line I added - heck I also reset my project files to head since I just started working on it anyways,
ran a fresh bundle, restarted the server, checked the site but all I'm getting is the error above..
I googled and tried to look for a similar question on SO but couldn't find any so the only thing I could really try was the uninstall and reset my git.
I'm definitely looking over something really stupid but can't really find the answer so here I am ;)
Any help is appriciated, thanks in advance and comment if I missed info that you guys need.
time of writing
I actually did a quick gem pristine --all with no results either.
EDIT 1
Okay, so with abit of guesswork and the same situation happening before resulting in the recreation of a fresh app in the (short) past I uninstalled the compass-rails gem and ran bundle afterwhich rails s to test if things started working.
It did. Then I went on and reinstalled compass-rails and it kept working... getting quite confused now :S
Okay so here goes:
I've found the problem and it was solved by actually supplying a version that works with rails 4.2.
The default gem compass-rails installs a version incompatible with sprockets.
When I added the specific version as seen here and ran another bundle the versions of most of the packages I named in the question changed.
console output after gemfile modification included:
Installing sprockets 2.12.3 (was 3.0.0)
Using sprockets-rails 2.3.1 (was 2.2.4)
Installing sass-rails 5.0.1 (was 5.0.3)
Installing compass-rails 2.0.4 (was 2.0.1)
Guess it's just waiting for compass to release a compatible version.

error Could not find i18n-0.7.0 in any of the sources

This Saturday (27th, December), I upgraded my project Rails version from version 4.1.5 to version 4.2.0. And I also upgraded the Ruby version from 2.1.2 to 2.1.5.
Today, I was trying to run a Controller generator: bin/rails g controller Clients index and I realized that the command is not working. I am getting this error:
Could not find i18n-0.7.0 in any of the sources
I tried other commands like: bin/rake db:migrate, bin/rake and the same problem.
But I can run the server using: bin/rails s. I can navigate through the website too.
I solved the problem.
The problem was, I upgraded the Rails version but I did not upgrade the bin/ folder.
So, to do that, I had to run the following command, and override everything:
$ bundle exec rake rails:update:bin
Thanks.
Try:
bin/bundle install
Solves the problem ;)
Earlier version was i18n --version 0.6.1
Issue got resolved using the below command.
sudo gem install i18n --version 0.7
I had the same issue and solved it by deleting the Gemfile.lock and running another bundle command.
After that, I was back to an earlier version of i18n (0.6.11) and everything worked as expected.
If you is using RVM you need reset your RVM gemsets, try this:
https://github.com/phusion/passenger/wiki/Resetting-RVM-gemsets
I did all of the above without result. Then I discovered that i18n couldn't be installed because my Ruby version was too low. (Said message was lost in the blast that bundler emits.) I updated Ruby and voila! i18n installed. NB: for some reason, Gemfile.lock showed it as installed even before this success, but RubyMine didn't show it as one of the installed libraries. Go figure.

upgrading ruby how to

I recently upgraded to ruby 1.8.7. i'm running Rails 2.3.5 and rubyGems 1.5.2.
ever since I upgraded, every time I want to start the server, i get:
undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x1022cc1c8> (NameError)
this post here advises to downgrade rugyGems to a version below 1.5.0.
downgrading doesn't seem to be the right solution..should I maybe be upgrading Ruby or Rails instead?
Also, if I upgrade to the latest ruby (1.9.2) and rails (3.0)..will my application break?
I have a very large application and can't figure out how to upgrade it without breaking the application..
That thing about version_requirements is a bug in rubygems - confirmed by their creators.
I've also participated in the bug report on the rubygems :)
gem update --system 1.5.0
performs a graceful downgrade until this is fixed.
I ran into this issue with some Rails 2.x applications and once also with 3.0.4 application, but with different error message, again, downgrading rubygems solved it.
You should use RVM so you can have both, 1.8 and 1.9.2 Ruby versions, running and you can be working with rails 2.3.x and rails 3.x the way that you want

Why does Rails think I have RubyGems 1.0.1 when I have v1.3.5?

I made a change to my shell profile and now when I try to run the Rails console on a Rails app I created, I get this message:
Loading development environment (Rails 2.3.4)
Rails requires RubyGems >= 1.3.2 (you have 1.0.1). Please `gem update --system` and try again.
However, when I run gem -v the output is 1.3.5. What happened here, and how do I fix it? I already renamed the gems version (along with Ruby 1.8.6 and Rails 1.2.6) that came with Leopard to "gem.orig". I added a debug to the Rails initializer and for some reason require 'rubygems' is loading v1.0.1 and not the installed version? How do I fix this? It happened all of a sudden when I changed my shell and configuration.
You probably need to re-set RUBYOPT for the new shell. Details are in the Gems documentation.

Resources