$ rails 6.0.2 new sample_app2
.
.
.
Using web-console 4.0.1
Using webdrivers 4.1.3
Using webpacker 4.2.2
Bundle complete! 17 Gemfile dependencies, 75 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
run bundle binstubs bundler
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Skipped bundle since it already exists.
If you want to overwrite skipped stubs, use --force.
run bundle exec spring binstub --all
* bin/rake: Spring inserted
* bin/rails: Spring inserted
rails webpacker:install
Traceback (most recent call last):
4: from /home/emsawy/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `'
3: from /home/emsawy/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
2: from /home/emsawy/.rvm/gems/ruby-2.6.3/bin/yarn:23:in `'
1: from /home/emsawy/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:400:in `block in replace_bin_path'
/home/emsawy/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/bundler/rubygems_integration.rb:372:in `block in replace_bin_path': can't find executable yarn for gem yarn. yarn is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
Also after performing Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
I got the same result
$ yarn -v
[DEPRECATION] The trollop gem has been renamed to optimist
and will no longer be supported. Please switch to optimist
as soon as possible. Yarn v0.1.1 2011 Jesper Kjeldgaard
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
$ rails -v
Rails 6.0.2.1
You installed yarn as a gem https://rubygems.org/gems/yarn and this is wrong.
Now you should do:
Uninstall this gem, gem uninstall yarn
On mac os brew install yarn if other platform then look here: https://yarnpkg.com/lang/en/docs/install/#debian-stable
Check version, should be something like:
yarn -v
1.21.1
Got the same error.
First uninstall yarn by commanding gem uninstall yarn.
It will ask yn, Enter yn
Next run: command gem update
Finally check yarn --version
Related
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/rubygems/rubygems/search?q=wrong+number+of+arguments+%28given+4%2C+expected+1%29&type=Issues
If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there.
I try to run 'bundle install' and I get this error. I am trying to run specs for a school project testing me on Ruby on Rails associations among other things. The project uses pSQL, Ruby and RoR. I am able to run 'bundle install && ./setup_db.sh' in the active_record_queries folder but not in the associations folder for that is where I receive the above comment. When I run just 'bundle install' I receive: Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
I also need to run ./setup_db.sh after as stated in the read me.
Why am I getting this error message?
/rails1_practice
├── README.md (<- you are here)
├── active_record_queries
| └── README.md
├── associations
| └── README.md
├── migrations
| └── README.md
├── sql
| └── README.md
ace#ace-ThinkPad-T460:/$ rake about rake aborted! No Rakefile found
(looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
ace#ace-ThinkPad-T460:/$ rake about rake aborted! No Rakefile found
(looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace) ace#ace-ThinkPad-T460:/$
rails -v Rails 7.0.2.2 ace#ace-ThinkPad-T460:/$ ruby -v ruby 3.1.1p18
(2022-02-18 revision 53f5fc4236) [x86_64-linux]
ace#ace-ThinkPad-T460:/$ rbenv -v rbenv 1.2.0-11-ge4f61e6
ace#ace-ThinkPad-T460:/$ gem -v
3.3.7
'''
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ ./setup_db.sh
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ gem update --systemn 3.2.3
Failed to load /home/ace/.gemrc, wrong number of arguments (given 2, expected 1)
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --systemn
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ gem update system
Failed to load /home/ace/.gemrc, wrong number of arguments (given 2, expected 1)
Updating installed gems
Nothing to update
'''
I'm make a rails server env in Docker.
the docker file like this :
FROM ruby:2.6.3-buster
...
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN gem install bundler -v 2.1.4
RUN gem install rake -v 13.0.1
RUN pwd
RUN bundle install # --full-index
CMD ["/bin/bash","./start-server.sh"]
then I go into container to test:
root#b3e642a78277:/app# bundle exec rails c
/usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:312:in `check_for_activated_spec!': You have already activated stringio 0.0.2, but your Gemfile requires stringio 0.1.4. Since stringio is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports stringio as a default gem. (Gem::LoadError)
root#b3e642a78277:/app# from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/runtime.rb:31:in `block in setup'
from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
from /usr/local/bundle/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
....
Seems the default gems conflict with what installed by bundler.
when I check the gem list in container :
root#b3e642a78277:/app# gem list|grep string
stringio (default: 0.0.2)
root#b3e642a78277:/app# bundle exec gem list|grep string
stringio (0.1.4)
Seems bundle use default gems instead of installed in bundler.
How can I ask bundle DO NOT use default gems ?
I am getting this error while trying to push my app to heroku:
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by runninggem install bundler. I have the following versions of bundler:
gem list | grep bundler
bundler (2.0.2, default: 1.17.3, 1.17.2)
I have tried various suggestions from different similar posts but I am not able to set the bundler version to 1.17.2 which is required by Heroku. I tried:
gem uninstall bundler
gem install bundler -v 1.17.2
1 gem installed
Then removed the lock file and rerunning the bundle update but the version 1.17.3 still comes as the default.
I tried gem uninstall bundler:1.17.3 which returned:
Successfully uninstalled bundler-1.17.3
Then: gem install bundler -v 1.17.2which returned:
Successfully installed bundler-1.17.2
1 gem installed
Now bundler -v returns a LoadError:
Traceback (most recent call last):
3: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/ruby_executable_hooks:24:in `<main>'
2: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/ruby_executable_hooks:24:in `eval'
1: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/bundler:23:in `<main>'
/home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/bundler:23:in `load': cannot load such file -- /home/amairu/.rvm/rubies/ruby-2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/exe/bundler (LoadError)
I am using rvm and I also tried to uninstall in the global gem set:
rvm use 2.6.1#global
gem uninstall bundler:1.17.3 which does not return any output or message.
How can I set the bundler to 1.17.2?
set your bundler version as a default version like below if you want to use 2.0.2
bundle _2.0.2_ -v
I had troubles with bundlers recently (Bundler v2.0.2 was installed, v1.17.3 set as default) but with a different error (Can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)).
Running gem update --system did a trick for me.
Install the correct bundler for your application with the following command:
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
I had a problem with Bundler (bundle cannot load such file bundler-1.17.1/exe/bundle), so I removed Bundler then manually removed all bundler directory:
gem uninstall bundler -x
gem cleanup bundler
Then removed with rm -rf from:
~/.gem/ruby/2.5.1/gems/bundler-1.17.1
~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1
and ~/.bundle
Now, I would like to reinstall bundler with the default version, 1.17.1.
So I tried gem install bundler
gem install bundler
Fetching: bundler-1.17.1.gem (100%)
Successfully installed bundler-1.17.1
Parsing documentation for bundler-1.17.1
Installing ri documentation for bundler-1.17.1
Done installing documentation for bundler after 3 seconds
1 gem installed
If I try to execute a bundle command, I get this error:
bundle
Traceback (most recent call last):
1: from /Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `<main>'
/Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `load': cannot load such file -- /Users/robin/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle (LoadError)
I can see bundler-1.17.1 in ~/.gem/ruby/2.5.1/gems/bundler-1.17.1 but not in .rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1. So I have to manually copy the folder:
cp -R ~/.gem/ruby/2.5.1/gems/bundler-1.17.1 ~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1
But now, if I try a bundle command, it works but I have this message in first line:
Warning: the running version of Bundler (1.16.2) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running 'gem install bundler'.
I tried to install bundler by gem install bundler -v 1.17.1 but I still have the problem.
gem list output:
gem list bundler
*** LOCAL GEMS ***
bundler (default: 1.17.1)
capistrano-bundler (1.4.0, 1.3.0)
my config:
macOS 10.13.6
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
chruby
ruby-2.5.0
* ruby-2.5.1
rails -v
Rails 5.2.1
gem -v
2.7.7
EDIT:
I forgot to specify than gem pristine bundler doesn't work with bundler:
gem pristine bundler
Restoring gems to pristine condition...
Skipped bundler-1.17.1, it is a default gem
And if I try to uninstall bundler twice, I get this message:
gem uninstall bundler -x
ERROR: While executing gem ... (Gem::InstallError)
gem "bundler" cannot be uninstalled because it is a default gem
So i don't know if bundler is really uninstalled the first time.
I am new to Rails , I ran bundler as root by mistake & now it is not working correctly. I tried to use gem uninstall bundler then gem install bundler but still it is not fixed.
How to make bundler work again for non root users (after mistakenly using it with root)?
Note:
I have installed and use rbenv, but after installing some gems on the system directly
The error that happens is that bundle doctor shows correct missing gems but sudo bundle doctor doesn't as shown below
~/my_ruby_projects/myblog3$ bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
The following gems are missing
* execjs (2.7.0)
* coffee-script (2.4.1)
* coffee-rails (4.2.2)
* font-awesome-rails (4.7.0.2)
* temple (0.8.0)
using sudo
~/my_ruby_projects/myblog3$ sudo bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run gem install bundler --pre
The Gemfile's dependencies are satisfied
No issues found with the installed bundle
Thanks for your help
update:
I knew that bundle with sudo is correct since it gave the real gems that rails tells me they are missing , if I use bundle install without sudo it gives error as below (even if change it to chmod 777)
~/my_ruby_projects/myblog3$ bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
There was an error while trying to write to `/home/usrname/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`. It is likely that you
need to grant write permissions for that path.
for sudo bundle install it says all is installed but then rails throws error that I need to install gems (which bundle doctor gave without sudo)
/my_ruby_projects/myblog3$ sudo bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using rake 12.0.0
Using concurrent-ruby 1.0.5
# many other gems
Using redis-rails 5.0.2
Using rails_admin 1.2.0
Bundle complete! 30 Gemfile dependencies, 98 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Update 2:
rails s was giving error that gem files are missing
but **sudo** rails s worked without errors
You should try changing the owner and setting the correct permissions for your ~/.bundle.
Try:
sudo chown -R <youruser> ~/.bundle
Followed by:
sudo chmod -R 655 ~/.bundle