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?
Related
I'm having trouble creating a new Rails app. I'm using a fresh WSL2 + Ubuntu 18.04 install.
Long story short, I followed the Rails installation procedure from https://gorails.com/setup/windows/10 but when installing bundle using gem install bundler, I end up with 2 bundler versions (2.1.2 and 2.1.4).
If I stick with 2.1.2 webpacker throws an error, so I definitely need to install the newest version. The problem is, when I install 2.1.4 the default version remains 2.1.2, so then I go to cd /.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/specifications/default and remove bundler-2.1.2.gemspec, and then I do a gem install bundler --default to get only v2.1.4 as default:
gem list bundler
*** LOCAL GEMS ***
bundler (default: 2.1.4)
But here is the problem; if I run bundler -v I get:
bundler -v
Bundler version 2.1.2
But the real problem is that, when running rails new, it clearly tries to use 2.1.2 which inevitably fails.
How can I solve this?
Thank you
Try gem uninstall bundler --version 2.1.2.
From the app directory run these commands:
gem install bundler
bundle update --bundler
bundle install
This rebuilds the Gemfile.lock with the correct Bundler version.
EDIT: You can create the directory first with rails new my_rails_app, then do cd .. ; rails new my_rails_app after running the above commands.
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.
I'm trying to set up a ruby project and rather new to the process of automating via bundle. However when I try to execute any bundle command I'm met with the following error:
/usr/local/bin/bundle:26:in `load': cannot load such file -- /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle (LoadError)
from /usr/local/bin/bundle:26:in `<main>'
I have tried removing and reinstalling Ruby, as well as removing the bundler gem itself. But to no avail. My Rubygems version is 2.3.0 and the Ruby version is 2.3.1 which is the latest stable version for Ubuntu
Problem related to bundler==1.16.1 try to reinstall with bundler=1.16.0 for now.
gem uninstall bundler -x
gem install bundler -v 1.16.0 --force
More info and bug report can be found here: https://github.com/bundler/bundler/issues/6227
I was able to uninstall bundler -v '1.16.1' as described by Mr.Coffee, but in gem list it was still listed and marked as default.
I created a symlink then - very hacky, but the only thing which worked for me:
ln -sf /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.0 /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1
The gem requesting bundler works now.
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
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