Ruby on Rails bundler: command not found: spring unable to proceed - ruby-on-rails

run bundle install --local
Could not find gem 'rails (= 4.2.6)' in any of the gem sources listed in your
Gemfile.
run bundle exec spring binstub --all
bundler: command not found: spring Install missing gem executables
with bundle install
Please help me solve this issue.

You will probably have Rails version different version of Rails(Its clear that you don't have 4.2.6 installed) installed(your rails project directory), but apparently you has updated it and now your project requires version 4.2.6. Update your gems:
bundle install

Related

Error installing nokogumbo gem with specific version

I am trying to do bundle install on my project.
Ruby: 2.5.1
Rails: 5.0.7.2
Bundler: 1.17.3
But when doing the bundle install, it gives me this error with the nokogumbo gem and it doesn't install it, I'm using a mac.enter image description here
Have you tried:
bundle config set force_ruby_platform true
bundle install
Otherwise, paste in your commands and the output so we can see a better view of what is going on.

rails bundler version issue

I have rails project working on Ubuntu.
Now I installed WSL on another machine and cloned the very same project.
Now when I try to install bundler with
gem install bundler
it installed bundler 2.0.2 and on bundle install it gives error:
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (~> 5.0.0)'
Now I looked at the gemfile.lock it was bundled with 1.16.4, I installed it with
gem install bundler -v '1.16.4'
Now I do a simple bundle install, then it uses 2.0.2, so I have to do
bundle _1.16.4_ install
It completed successfully, but now when I am trying to do rails db:create, it says
The git source https://github.com/activerecord-hackery/ransack.git is not yet checked out. Please run bundle install before trying to start your application
What's wrong here?
Uninstall bundler 2.0.2:
gem uninstall bundler -v 2.0.2
If you still have problem, you can use:
bundle exec rails db:create
You can update to using bundler 2.x if possible with:
bundle update --bundler
This will change the BUNDLED_WITH version in Gemfile.lock.
see: https://bundler.io/guides/bundler_2_upgrade.html
You could also set the default bundler version:
bundler config default 1.16.4
gem list bundler
However I have found this to be a bit error prone.
Try to remove all your gems (go to the gems folder of your ruby, remove the specifications folder and the gems folder),
gem list should be more or less empty
gem install bundler
And try to bundle install again from scratch.

Ruby on Rails Bundler issues LoadError

I believe I am having some PATH issues for my gems.
I am using rvm (version 1.29.3) with ruby (version 2.4.1) and rails (version 5.1.4)
I tried to run rails new myapp to which I get the following LoadErrors:
remove config/initializers/new_framework_defaults_5_1.rb
run bundle install
/Users/fabienbessez/.rvm/rubies/ruby-2.4.1/bin/ruby: No such file or directory
-- /Users/fabienbessez/.rvm/rubies/ruby-
2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle (LoadError)
run bundle exec spring binstub --all
/Users/fabienbessez/.rvm/rubies/ruby-2.4.1/bin/ruby: No such file or directory
-- /Users/fabienbessez/.rvm/rubies/ruby
2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle (LoadError)
I get the same error when I try to then run bundle install
I checked the contents of ~/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems to which I found that bundler-1.15.4 but not bundler-1.16.0. I assume that that is the issue. But I can't figure out how to update those gems. gem install bundler says it has installed bundler 1.16.0 but this is not being updated.
Any ideas??
Thanks!
Have you tried to uninstall all old versions of bundler with gem uninstall bundler?

Failed generating controller due to Bundler version conflict

I'm learning Rails with tutorials from Ruby on Rails by Michael Hartl: https://www.railstutorial.org/book
I used the following command to generate a controller:
rails generate controller StaticPages home help
Which generates the following error regarding version conflicts:
check_version_conflict': can't activate bundler-1.12.4, already
activated bundler-1.13.0.pre.1 (Gem::LoadError)
I don't know which bundler version to use. The current version of bundler is: 1.13.pre.1
The following command continued failing due to about five gem dependencies that failed to install automatically, which included listen and nokigiri.
bundle install --without production
I tried installing the dependent gems manually, but I'm still having issues.
How do I resolve the check_version_conflict issue with Bundler when generating Rails controllers?
I'll accept an answer that instructs removing current Ruby libs and installing a new development environment from scratch.
Bundler will install project-specific versions of your gems so that you don't have to manage global dependencies.
In effect, if you install Rails with bundler and you also install it with sudo gem install rails or something like that, you'll have two versions on your computer. By default, calling rails will refer to the global version.
If you call bundle exec rails (or bundle exec <gem_name>), it will call the bundler-specific version.
Ten steps to resolve your issues with Bundler
(optional) Uninstall Ruby. There are many ways to do so, here's one: https://superuser.com/questions/194051/how-to-completely-remove-ruby-ruby-gems-on-mac-os-x-10-6-4
(optional) Use rbenv to install Ruby. Follow instructions here: https://github.com/rbenv/rbenv
Make a repo directory that will house your future Rails app
From the command line:
mkdir repo
cd repo
Install Bundler and create a Gemfile for the directory
From the command line:
gem install bundler
bundle init
Open the repo/Gemfile with your editor, and configure it to instruct Bundler which version of Rails to install
In repo/Gemfile:
source "https://rubygems.org"
gem "rails", "4.2.6"
Install Rails via Bundler
From the command line:
bundle install
Create a new Rails app using Bundler, and cd into it
From the command line:
bundle exec rails new whatevs
cd whatevs
Your Rails app will have a Gemfile by default. Open it and add the gems you wish to use in your app.
In repo/whatevs/Gemfile:
gem 'nokogiri', '1.6.8'
From repo/whatevs/ directory, install your app's Gems via Bundler
From the command line:
bundle install
From repo/whatevs/ directory, generate a controller
From the command line:
bundle exec rails generate controller static_pages home help

How Do You Install Missing sass-rails gem?

Hi new to stackoverflow and Ruby on Rails in general. I'm following the Kevin Skoglund Ruby on Rails 3 Essential Training online tutorial and I'm having trouble starting out. I'm trying to boot WEBrick but each time I try I get this error:
C:\Users\Matt\Documents\Sites\simple_cms>rails server
Could not find gem 'sass-rails (~> 5.0) x86-mingw32' in any of the gem sources l
isted in your Gemfile or installed on this machine.
Run bundle install to install missing gems.
What do I do to install this missing sass-rails gem, so I can boot WEBrick?
You can certainly run bundle install in your terminal, or command line, as the output suggests.
$ bundle install
If that fails, run:
$ gem install bundler
$ bundle install

Resources