Source does not contain any versions of 'rails-assets-lodash (~> 2.4) - ruby-on-rails

I'm trying to help debug a project. I'm getting a really weird error when I try to run the server. I tried to google the gem but no luck. Anyone have any ideas? I tried bundle install and bundle update.
Here is the actual block of code I'm trying to run.
source 'https://rails-assets.org' do
# Assets via Bower
gem 'rails-assets-lodash', '~> 2.4'
gem 'rails-assets-angular', '~> 1.2'
gem 'rails-assets-angular-spree', '= 0.0.2'
end
error: Source does not contain any versions of 'rails-assets-lodash (~> 2.4) ruby' Run bundle install to install missing gems.
If I comment out the first gem I get similar error with the gem proceeding it. When I comment out the block it does work though, but I was instructed not to change the environment.

If you are using Bundler 1.8.0-1.8.2, you are probably hitting this bug: https://github.com/bundler/bundler/issues/3414
This should be fixed in Bundler 1.8.3 (released today).

Related

How to use a specific Nokogiri version for Rails application

I'm trying to run a Rails application that I wrote a couple of years ago, however I keep getting this error when I run rails server:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'nokogiri' (>= 1.5.9) - did find: [nokogiri-1.5.6] (Gem::LoadError)
I'm pretty confused, since I have Nokogiri v1.8.2 and v1.10.7 installed and see them under .gem/ruby/2.3.0 and /Library/Ruby/Gems/2.3.0. I don't see Nokogiri v1.5.6 though, so I'm not sure where the application is getting that from.
I tried adding
gem 'nokogiri', '~> 1.10', '>= 1.10.3'
to the Gemfile, as well as
gem 'nokogiri', '~> 1.5.6'
I'm trying to figure out if I can change the GEM_PATH, but hopefully there's another solution I'm not seeing.
Nokogiri is used by Rails, so you don't need to add it to your Gemfile, but you can update the version in your Gemfile.lock using:
bundle update nokogiri

Could not find gem 'canvas_connect (= 0.3.12 )' in any of the gem sources listed in your Gemfile or available on this machine

When run bundle install getting this error https://i.stack.imgur.com/V4O3U.png
In Gemfile
gem 'canvas_connect', '0.3.12'
gem 'adobe_connect', '1.0.6', require: false
Canvas Connect Check this link for the available versions, the version mentioned in your Gemfile is wrong. Either update it with the version which you want to just remove it. Bundle will install the latest available .
adobe_connect is a dependent gem and recheck the version mentioned with available versions.
Rubygems.org should be used as reference to compare and find gem versions
Try installing these gems
gem 'canvas_connect', '~> 0.3.11'
and
gem 'adobe_connect', '~> 1.0', '>= 1.0.6', require: false
It seems like 0.3.11 is the latest version for canvas_connect.

Globalid and pg not existing when in gemfile

I am trying to rails server from a cloned repo, I have updated ruby, and rails, followed the rvm process, updated all my gem files, and when I go to serve I receive the message
Could not find globalid-0.3.7 in any of the sources Run bundle
install to install missing gems.
So I do bundle install, then get the error
An error occurred while installing pg (0.20.0), and Bundler cannot
continue. Make sure that gem install pg -v '0.20.0' succeeds before
bundling.
Try to insall that and then get
ERROR: Could not find a valid gem 'globalid-0.3.7' (>= 0) in any
repository ERROR: Possible alternatives: globalid, globalize3
I have googled everything and asked many.
globalid is a dependency of the Rails core gem ActiveJob so it is a required gem to have in your Gemfile.lock. See if it is listed in your Gemfile.lock file. If not you could add it to the top of your gemfile including the version
# gemfile
gem 'globalid', '0.3.7'
Then bundle install. If it works, then you can delete it from your gemfile since it should load automatically when Rails loads (since it is a dependency of Rails' ActiveJob). I've run into a similar issue with another gem and this process worked for me.
It could be a version error. Try using gem 'globalid', '~> 0.4.0' in your gemfile and bundling.

Cannot install gem march_hare

I tried adding this to my Gemfile:
gem 'march_hare', '~> 2.22'
Using bundle install I got this message:
Could not find gem 'march_hare (~> 2.22)' in any of the gem sources listed in
your Gemfile or available on this machine.
On the topmost line in my Gemfile, I have this :
source 'https://rubygems.org'
When I manually visit the rubygems and I m able to find this gem here :
https://rubygems.org/gems/march_hare
How do I install this gem? I don't understand what is happening.
It doesn't work with any jRuby older than 9.0, this was a miss on my part

Error stating that "bcrypt-ruby is not part of the bundle", how can I add bcrypt-ruby to Gemfile?

When I add has_secure_password to the model (inherited from ActiveRecord::Base), error stating that "bcrypt-ruby is not part of the bundle" occurs.
Here the log is:
Started GET "/users" for 127.0.0.1 at 2012-02-19 16:37:12 +0900
Gem::LoadError (bcrypt-ruby is not part of the bundle. Add it to Gemfile.):
app/models/user.rb:3:in `<class:User>'
app/models/user.rb:1:in `<top (required)>'
app/controllers/users_controller.rb:1:in `<top (required)>'
I installed bcrypt-ruby by
$ gem install bcrypt-ruby
Building native extensions. This could take a while...
1 gem installed
Installing YARD (yri) index for bcrypt-ruby-3.0.1...
Installing RDoc documentation for bcrypt-ruby-3.0.1...
but was no avail.
I tried
$ bundle exec rails server
but was no help.
If I comment out the line "has_secure_password", this error does not come out.
How can I solve this problem?
I already had gem 'bcrypt-ruby', '~> 3.0.0' in Gemfile, and had already ran the command bundle, and yet I still got that message. The problem was that I forgot to restart the server:
touch tmp/restart.txt
As the message says you need to add bcrypt-ruby to your Gemfile (at the root of the project).
Adding
gem "bcrypt-ruby"
and then running bundle install should do the trick (this would fetch the gem if you hadn't already installed it).
You can specify specific versions to, eg
gem "bcrypt-ruby", "~> 3.0.1"
will get you the latest version that is >= to 3.0.1 but less than 3.1. You might do this if 3.0.1 has a bug fix you depend on and you're happy to get more bug fixes but you don't want major changes. There's loads more info on the bundler website.
In your Gemfile add a line
gem 'bcrypt-ruby'
and then from the command line
bundle install
Something that came up for me that is not addressed here yet. I got this error after going to a new system on which I installed Ruby 2.0.x.
It turns out that even if I was using the new bcrypt 3.1.7 it didn't work for me until I ALSO had bcrypt-ruby 3.0.1 in the gemfile. I resisted that when I should have just taken the error at it's word.
gems:
bcrypt (3.1.7 ruby x86-mingw32)
bcrypt-ruby (3.0.1 x86-mingw32, 3.0.0)
gemfile:
gem 'bcrypt-ruby', '~> 3.0.1'
gem 'bcrypt', '~> 3.1.7'
Before adding both I tried all sorts of single version combinations.
Restart the server and reinstall bundle in correct order, that is:
bundle install, bundle update, bundle install
and then server restart.
If you already put the gem in the gem file and bundle installed and you are still getting an error then restart your server.

Resources