Solidus gem showing error regarding ruby version during bundle install - ruby-on-rails

I am trying to install Solidus gem which is a fork of spree and while running bundle install this shows up
Installing solidus_core 1.1.0
Gem::InstallError: solidus_core requires Ruby version >= 2.1.0.
An error occurred while installing solidus_core (1.1.0), and Bundler cannot
continue.
even when I am running ruby version 2.2.3
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
I am using rbenv on OS X El Capitan to control the ruby versions. Is there a problem with ruby version control or any other issue?

Try to set ruby '2.2.3' in Gemfile, and execute bundle install.
If it's not resolved, please check your bundle path to execute this:
$ which bundle
/usr/bin/bundle # global
$ gem install bundler
$ bundle install --path vendor/bundle

Related

Bundler version wrong?

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.

How to fix 'Your Ruby version is 2.3.3, but your Gemfile specified 2.5.2'

I got an error: Your Ruby version is 2.3.3, but your Gemfile specified 2.5.2 with running bundle install.
Besides, ruby -v shows ruby 2.5.2p104 (2018-10-18 revision 65133) [x86_64-linux].
OS: Debian 9
Problem with bundler was solved with: Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0
But now there is the same error with rails s
The problem was solved by,
rvm reinstall ruby-2.5.2
rvm default use ruby-2.5.2
bundle install
bin/rails s

Installed Ruby version are different in macOS and Bundle

I'm not using RVM but brew to install and update Ruby and Gem version up-to-date. But when I was trying bundle install, I got an error showed that the Ruby version requirement does not conform.
I added ruby '2.1.9' to the Gemfile and did some check:
(●—●) ↪ bundle platform
Your platform is: universal.x86_64-darwin16
Your app has gems that work on these platforms:
* ruby
Your Gemfile specifies a Ruby version requirement:
* ruby 2.1.9
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.9
(●—●) ↪ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
(●—●) ↪ gem -v
2.6.11
I found that there is a lower version Ruby in my project.
/Users/veck/Desktop/Project/vendor/bundle/ruby/2.0.0
How do I fix this problem?
I found that I successfully did bundle install with following action:
gem install bundler
After this installation, my vendor/bundle/ruby has one more version 2.4.0. Then I retry bundle install and all works fine.
Note: But 2.0.0 version of ruby still stay in vendor/bundle.

Your Ruby version is 2.2.4, but your Gemfile specified 2.3.0?

I'm trying to bundle install a ruby project in Git Bash but I'm getting the above message.
ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i836-mingw32]
gem -v
2.3.0
New to Ruby so its really frustrating. I'm trying to do the project below
http://www.viralrails.com/?p=25
This happens because you are specifying a Ruby version in your Gemfile (2.3.0) and this version is not installed or is not the current or default version.
Don't remove the line ruby '2.3.0' as someone said above. You app may have dependencies to this version. Do the following:
1) Check if you have Ruby 2.3.0 installed. If you are using rvm this may be done by
rvm list
and if you are using rbenv by
rbenv versions
2) If you don't have this Ruby version in your list of installed versions, then install it by issuing the following command
rvm install 2.3.0
and if you are using rbenv by
rbenv install 2.3.0
3) If you already had Ruby 2.3.0 installed or completed step 2 above, enter your app directory and issue the following command
rvm use 2.3.0
and if you are using rbenv by
rbenv local 2.3.0
Then run
bundle install
and I believe things will be ok.
Hope it helps!
Install bundler after installing ruby 2.4.0.
gem install bundler
If you installed bundler before installing ruby 2.4.0 then you should reinstall bundler or update it.
Also if the above command didn't work.
gem update bundler

Cannot install rails gem

Somehow my rails installation hides itself successfully...
I have:
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm 1.10.0-pre
gem 1.8.10
and I try to install rails:
sudo gem install rails
it works fine:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
when I do:
rails - v
I get
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Also, when I do
rake
in a rails app root directory, I get:
Missing the Rails gem. Please `gem install -v= rails`, update your
RAILS_GEM_VERSION setting in config/environment.rb for the Rails version
you do have installed, or comment out RAILS_GEM_VERSION to use the
latest version installed.
executing
gem install -v= rails
raises an error:
ERROR: While executing gem ... (ArgumentError)
Illformed requirement ["="]
So apparently it is sitting somewhere and cannot be seen by my environment. I guess installing via apt-get is not an option as I don't want to confuse gem...
Any ideas?
Cheers
Mac
Do not use sudo.
Just gem install rails
Use RVM instead of the packaged ruby/gems distribution. http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Resources