Rails could not find gem - ruby-on-rails

when tried to start server rails s i have got
Could not find minitest-5.9.0 in any of the sources
Run `bundle install` to install missing gems.
i did gem install minitest -v 5.9.0
Successfully installed minitest-5.9.0
1 gem installed
also gem list
minitest (5.9.0, 4.7.5)
but when i try rails s again i received the same error.
How could i fix it?

bundle install
If you have tried that, try
bundle update
This will update your gems and your gemfile.lock

Best to specify the version you want in your Gemfile, at present you have 2 versions which will be causing the conflicts.
Something like gem 'minitest ', '~> 5.90' would do the trick. Once you have done this do bundle update this will ensure you update Gemfile to use the correct version of specified gem

Related

How to completely revert gem version?

I'm trying to revert the 'bootstrap' gem from 'alpha6' to 'alpha3'.
I've run:
$ gem uninstall bootstrap
Select gem to uninstall:
1. bootstrap-4.0.0.alpha3
2. bootstrap-4.0.0.alpha6
3. All versions
> 2
Successfully uninstalled bootstrap-4.0.0.alpha6`
but when I try to start the server I get:
$ rails server
Could not find bootstrap-4.0.0.alpha6 in any of the sources
Run `bundle install` to install missing gems.
here's what's in my gemfile:
gem 'bootstrap', '~> 4.0.0.alpha3'
rails is still looking for alpha6. how do I tell rails to forget about alpha 6 and move on with it's life?
Here's how I fixed it:
run:
$ gem uninstall bootstrap
Successfully uninstalled bootstrap-4.0.0.alpha6
add the gem like this in your Gemfile, getting rid of the ~>
gem 'bootstrap', '4.0.0.alpha3'
run
$ bundle install
hopefully you see the nice message:
Installing bootstrap 4.0.0.alpha3 (was 4.0.0.alpha6)

downgrading the gem coffee-script-source' to 1.8.0

I am getting this error:
ExecJS::ProgramError in Welcome#indexExecJS::ProgramError in Welcome#index.
According to others posts that error happens because there is a problem with coffee-script-source 1.9.0 running on windows. Actually, I am currently on coffee-script-source 1.10.0. Anyway, apparently, I have to downgrade the gem with the adding
gem 'coffee-script-source', '1.8.0'
to my gem file and runny commands:
bundle update
or
bundle install
Although I am in the directory of the gemfile, I get this message in cmd:
The system cannot find the path specified.
What is it that I am doing wrong?
Apparently, windows did not know how to run bundle command. But using ruby bundle worked and the gemfile was updated.
It seems that bundle is not installed. Therefore, you better install it first by
gem install bundle
and then bundle command works.

Rails can't find JSON gem but bundle install can?

Just upgraded to OS X El Capitan and trying to create a new rails app for the first time since the upgrade. After a few hurdles (and alot of googling) I finally got the app created. When I try to create a new model using rails g model Mymodel I get this error:
Could not find json-1.8.3 in any of the sources
Run `bundle install` to install missing gems.
When I run bundle install I get this:
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
...
Bundle complete! 13 Gemfile dependencies, 54 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
When I run bundle show json I get:
/usr/local/lib/ruby/gems/2.2.0/gems/json-1.8.3
I know the basics of the rails setup but any troubleshooting like this has always been over my head. I imagine the solution is probably simple but by google searches haven't given me anything. Maybe I'm just not searching with the correct phrasing. Anyhow, does anyone have any idea what's going on and how to fix it?
Much appreciation!
UPDATE:
When I try to uninstall so I can reinstall I get the error:
ERROR: While executing gem ... (Gem::InstallError)
gem "json" cannot be uninstalled because it is a default gem
UPDATE 2:
The only thing I'm doing different than other new apps I've created is adding bootstrap. In my Gemfile I have:
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
I thought maybe one of them was causing the issue so I started by removing the autoprefixer gem from my Gemfile. I then ran the g model command and I got this error:
Could not find autoprefixer-rails-6.1.0.1 in any of the sources
Run `bundle install` to install missing gems.
which is the same as the previous error but with a different gem. So, I put the gem back into the Gemfile and I'm still getting that error. I have no idea what's going on. Any ideas?

Unable to install Doorkeeper-MongoDB

I have a fresh installation of rails 4 with MongoMapper. Now i'm trying to install doorkeeper on my rails instance.
I added the "gem 'doorkeeper-mongodb'" line in my Gemfile. Then I ran 'bundle install'. And I got the following error :
Could not find gem 'doorkeeper-mongodb (>= 0) ruby' in any of the gem sources listed in your Gemfile or available on this machine.
Also, I tried to install it using the gem install command but it doesn't work either.
I'm on Mac OS X.
The line to put in the Gemfile is
gem 'doorkeeper-mongodb', github: 'doorkeeper-gem/doorkeeper-mongodb'
I tried checking the gems in https://rubygems.org and could not find doorkeeper-mongodb.
And then googled out, and found that if you want to install gems from github source, then the right way seems like this following:
gem 'doorkeeper-mongodb', :git => 'git://github.com/doorkeeper-gem/doorkeeper-mongodb.git'
Or you can also download the source from github, and install it from local.

I'm having trouble running my Rails web server

I have installed ruby193 and I've installed rails via the command prompt (I also installed a DevKit). However, whenever I try the command:
rails server
I get this error:
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m
I've tried a bundle install and it gives me an error with when trying to install the json gem. Any suggestions?
make sure in your Gemfile you are including the right gem (no misspellings, etc)
Looks like you are on Windows.
I defeated the very same problem on Windows by manually installing my gems from Gemfile (gem install gem_to_install). After successfully installing a particular gem I ran bundle check to see what else I need to install. And this way after few installed gems I ran bundle check again and saw the output The Gemfile's dependencies are satisfied.
And then server started. I wish you the same!
P.S. You can install few gems at once: gem install gem1 gem2.

Resources