I am trying to install ruby version 2.1.2 using rvm.
Below is the details of the same. Installation of ruby 2.1.2 through rvm is completed with following warnings.
After installation, when doing gem list getting below error.
I am pretty new to ruby on rails. Any leads on how to solve this please?
Related
I have Ruby 2.7.2 and Rails 6.1.3.1 installed on my Ubuntu 20.04 machine. However, when I try to test a ruby command using the command below:
irb
a = 1
I get the error below:
/home/mycomputer/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.3.5/lib/irb/ruby-lex.rb:50:in block in set_input': undefined method in_pasting?' for Reline::ANSI:Class (NoMethodError)
I am still tryring to fix it, but it's working.
The error was caused by an issue with the reline gem in the Ruby 2.7.2 setup. However, if I switch to another Ruby version (2.6.6) using rbenv global 2.6.6 everything seems to work fine.
Here's how I fixed it:
Solution 1:
Since the reline gem comes with Ruby installations, we will uninstall the ruby 2.7.2 version that is the cause of the issue using rbenv :
rbenv uninstall 2.7.2
Next, reinstall the ruby 2.7.2 version that is the cause of the issue using rbenv :
rbenv install 2.7.2
Afterwhich you will install the version of Bunder and Rails that you are using. In this case, my Rails version is Rails 6.1.3.1:
gem install bundler
gem install rails -v 6.1.3.1
rbenv rehash
You can afterwards, check the version of ruby, bundler and rails that were installed using the command below:
ruby -v
bundler -v
rails -v
This time when you try to test again using irb it should work fine.
Solution 2:
A faster approach will be to uninstall the reline gem in the Ruby 2.7.2 setup using the command below:
gem uninstall reline
And then reinstall it:
gem install reline
Note:
I did not test this to confirm if it fixes the issue.
That's all.
I hope this helps
While attempting to solve another issue identified in this thread:
Error while trying to load the gem 'devise. ActiveSupport: Duration can't be coerced into Integer, I followed the suggested solution and changed my ruby version from 2.4.1 to 2.3.3 using rbenv. I also made similar changes in my Gemfile to reflect the new ruby version. However, when I tried to bundle install again, it throws an error saying that my ruby version is 2.4.1, when my Gem specified 2.3.3. However, running ruby -v shows my ruby version is on 2.3.3.
$ bundle install
Your Ruby version is 2.4.1, but your Gemfile specified 2.3.3
$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
Any help here would be appreciated. Thank you!
Gem installation is specific to ruby version, so the bundler you're using is likely installed to your old ruby. Try installing bundler again:
gem install bundler
That should fix your problem.
Im facing this problem when i'm installing bunder using command "bunlde install"
Initially i tried solving this issue by using following command
gem install autoprefixer-rails -v '6.2.2'
but again it said "autoprefixer-rails requires ruby version >= 2.0."
when i type
"ruby -v", my ruby version shows 2.3.0.
Next i have tried adding
ruby '2.3.0' to my gem file, then there was a conflict saying your ruby version is 1.9.3 but your gem file has 2.3.0
Need help how to proceed further.
Change your ruby version in the system first. If you using rvm then use following command.
rvm use 2.3.0
If you don't have it then install it by following command
rvm install 2.3.0
Delete the Gemfile.lock file and run
bundle install
Hopefully it will work. Thank you
I had already installed rails 1.8.7, forgot about it, then installed 1.9.3 through RVM. I was getting weird errors, so I purged my Mac of the system version of Ruby and started again using RVM. So far I've
Installed Ruby:
rvm reinstall 1.9.3-p0
which ruby
/Users/User/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
Manually setup Rubygems
which gem
/Users/User/.rvm/rubies/ruby-1.9.3-p0/bin/gem
Tried to install rails
sudo gem install rails
Successfully installed rails-3.2.1
1 gem installed
gem list
rails (3.2.1, 3.2.0)
It says rails is installed, but which gem does not work, and when I try to use rails new I get:
-bash: rails: command not found
I'm definitely missing something here. The only explanation I can think of is that there are remnants of a previous ruby or rails install that's causing problems. Is there a way to start completely from scratch?
If you are using RVM, you should not use "sudo" when you install gems. That will install gems to your system ruby version (not on the RVM rubies).
First, set up default rvm ruby like
rvm use ruby-1.9.3-p0 --default
Then, install rails on it by running:
gem install rails -v=3.2.1
It's actually better to use gemsets so you can have different gems set for the same ruby version. Check here for more info.
I am new to ruby on rails. I installed ruby and gems both on my ubuntu 10.10 system. My rails -v is 3.0.5 and gem -v is 1.3.7. As my requirement I installed bundler and after that when I installed spree by the command gem install spree I got the following error message:
ERROR: Error installing spree:
spree_core requires will_paginate (= 3.0.pre2, runtime)
I googled many hours but didn't find any good result. So please help me.I am really a newbie in Rails.
Have you tried the following?
gem update --system
gem install will_paginate -v=3.0.pre2 --pre
gem install spree
You tell it manually to install the correct required version of will_paginate. Maybe that helps. Good luck.
This should all work through bundler. Have you added the spree gem to your Gemfile and run bundle install? Are you using RVM? Post the results of bundle list and rvm info(if applicable) if you're still having problems