I've been trying to set up ruby on rails.
I'd create a new project with
# rails new test
and I'd get this error message
Traceback (most recent call last):
6: from /usr/bin/rails:23:in `<main>'
5: from /usr/lib/ruby/2.7.0/rubygems.rb:295:in `activate_bin_path'
4: from /usr/lib/ruby/2.7.0/rubygems.rb:295:in `synchronize'
3: from /usr/lib/ruby/2.7.0/rubygems.rb:297:in `block in activate_bin_path'
2: from /usr/lib/ruby/2.7.0/rubygems.rb:230:in `finish_resolve'
1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:175:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:175:in `ensure in require': CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true (RuntimeError)
I have been at for quite some time and I can't find a solution.
I've also made sure everything is updated with # gem update
And sorry if this is a simple problem, I am rather new to ruby on rails. I gather it might be a problem with the monitor package?
I'm running Linux with kernel 5.6.11-arch1-1 if that helps
Not sure if this is the same problem or not, but I had a similar error (not in Rails) and this page is the first that appears in Google, so I am posting a solution if someone else happens to land here.
For me, what solved it was to run:
$ gem clean
Try reinstalling the Bundler by using
gem install bundler
Then you can run
bundle install
Related
Booting up localhost, I type in 'rails s' into my terminal. I get this error:
Traceback (most recent call last):
5: from bin/rails:3:in `<main>'
4: from bin/rails:3:in `load'
3: from /Users/macbookpro/flippingUnleashedCRM/bin/spring:10:in `<top (required)>'
2: from /Users/macbookpro/flippingUnleashedCRM/bin/spring:10:in `new'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
So, I type in bundler --version to see what I am using. The result is:
Bundler version 2.2.11
I take a look in my Gemfile.lock, I scroll down, and I see:
RUBY VERSION
ruby 2.5.1p57
BUNDLED WITH
2.2.11
What the heck is the problem?
It seems like a couple things could be going wrong here:
To potentially resolve your immediate issue, try running bundle exec rails s. This will run rails in the context of your bundle.
Secondly, you should also make sure your Ruby version matches the version specified. Like another comment mentioned, you seem to be running on Ruby 2.6 on a project that is on Ruby 2.5. A Ruby version manager like chruby will help you manage your Ruby versions and gem dependencies on each version better.
I'm trying to run a rails s command in the terminal,but I keep receiving a trace back: of multiple errors.
I tried have multiple ways to solve this issue but to no avail not has granted me with a solution.
Traceback (most recent call last):
4: from ./bin/rails:3:in `<main>'
3: from ./bin/rails:3:in `load'
2: from /home/zac/code2/rails-mister-cocktail/bin/spring:8:in `<top (required)>'
1: from /home/zac/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/home/zac/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)
I expected the server to run without any issues.
I was having the same error. If you have versions of ruby, bundler or rails installed on your machine that are different than the ones being used in the rails app you're trying to run, then installing the matching versions can make it work. Check the bundler version that was used on the app so you can run in the terminal:
gem install bundler -v '~> 1.17.3' (replace 1.17.3 with the version being used)
Also check the ruby and rails versions you have match the versions described in the Gemfile. You can check the versions you have installed with ruby -v and rails -v
I'm getting this error when trying to run the gem command. Does anyone know what is causing this? It's causing me to be not able to run rails g migration commands (I get a similar error), and I'd imagine probably a lot more.
Error loading RubyGems plugin "/Users/storwell/.rvm/gems/ruby-2.0.0-p247#global/gems/executable-hooks-1.2.2/lib/rubygems_plugin.rb": undefined method `stubs' for Gem::Specification:Class (NoMethodError)
/Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:255:in `matching_specs': undefined method `stubs' for Gem::Specification:Class (NoMethodError)
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:279:in `to_specs'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:309:in `to_spec'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems.rb:572:in `load_yaml'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:327:in `load_file'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:196:in `initialize'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `new'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in `run'
from /Users/storwell/.rvm/rubies/ruby-2.0.0-p247/bin/gem:21:in `<main>'
Update: I've also tried the rake command and it throws the same error.
I found an older link related to the same problem
, and it seems that it might be either a (1) Ruby installation issue, or (2) RubyGem issue. If it a Ruby issue, you need to uninstall and reinstall Ruby by using RVM (Ruby Version Manager) it seems that it worked for some. If it's (2) RubyGem issue (which it probably is), you either have to delete '/Users/storwell/.rvm/gems/ruby-2.0.0-p247#global/gems/executable-hooks-1.2.2/' folder or change the content in rubygems_plugin.rb file.
One of the users suggested (you can find from the link):
*"When I use "gem -v", the response will give me the error "Error loading RubyGems plugin "/Users/mercury/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.2.8/lib/rubygems_plugin.rb": cannot load such file -- rubygems_bundler/rubygems_bundler_installer (LoadError)
So I edit "rubygems_plugins.rb", and I change the require path of rubygems_bundler, the path after modified is "./rubygems_bundler/{file_name}", and the problem solved."*
I hope these instructions + link will help you to solve the problem. I did go through the same tutorial book by Michael Hartl last summer. I think I have encountered a similar issue. I think I might have deleted one folder in order solve the issue, and perhaps reinstalled something as well (but I am not 100% because it has been a while) .
Try calling
$gem update --system
I'm new to programming and am trying to set up Ruby on Rails using Michael Hartl's tutorial via Terminal on a Mac running Snow Leopard, but I'm a bit stuck on this part. I've tried using rvm 1.9.2, without any luck, and haven't been able to find anything googling. Any help would be appreciated!
Thanks!
CZom$ gem install rails -v 3.2.3
/Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:253:in `read': Is a directory - /Users/CZom/.gemrc (Errno::EISDIR)
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:253:in `load_file'
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:191:in `initialize'
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `new'
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:78:in `do_configuration'
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:51:in `run'
from /Users/CZom/.rvm/rubies/ruby-1.9.3-p194/bin/gem:25:in `<main>'
/Users/CZom/.gemrc should be a user specific config file that gets loaded when executing the gem command. Sounds like in your case it is a directory instead. Rubygems is complaining therefore.
Try to rename /Users/CZom/.gemrc or remove it completely if it isn't needed.
I was trying to use rspec and for some reason it wasn't working. I think it lacked some dependencies or something. Everything else in Ruby 1.9 was working perfectly on my laptop though. So I did a ruby gems system update (sudo gem update --system). I then did a gem update (sudo gem update). When I tried to run or create apps in rails I get the below listed error message: I also get this same message when I try to do gem update, gem install, gem clean, etc. I am confused. I even tried to update bundler to the latest version but I still get this same error message. I hope someone can help. Thanks.
demetrius-fords-macbook-pro-17:~ demet8$ gem check
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-0.8.1/lib/rubygems_plugin.rb:2:in require': no such file to load -- bundler/commands/bundle_command (LoadError)
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-0.8.1/lib/rubygems_plugin.rb:2:in'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1113:in load'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1113:inblock in '
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1105:in each'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1105:in'
from :225:in require'
from <internal:gem_prelude>:225:inload_full_rubygems_library'
from :324:in const_missing'
from /usr/local/bin/gem:12:in'
Your backtrace indicates that you're running Bundler 0.8.1. Please uninstall it and make sure you have a more recent version of bundler installed :)