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
Related
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.
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).
I´m totally lost so i will try to explain my problem.
Actually im reading the book Ruby on Rails tutorial. I´m actually installing all the environment to start learning this language.
The book asks me to update the Gemfile, and add this
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
So i delete my old gem sass-rails, my old gem coffee-rails and my old gem uglifier.
After doing this the book asks me to save it and run Bundle install on my console.
After doing this i get this message:
You have requested:
coffee-rails = 3.2.2
The bundle currently has coffee-rails locked at 4.0.1.
Try running `bundle update coffee-rails`
So i´m totally lost, and i have no idea what i´m doing cause im only following the steps from the book. Someone could help me and tell me what i should do here? Why the book is asking me to do all this if then it does´t work?
Sounds like you have already done a bundle install on a newer (probably without the version requirement) of coffee-rails and that is currently locked down in your Gemfile.lock file.
Do what it says and run bundle update coffee-rails to update your Gemfile.lock file to the version you specify
I'm beginner in Ruby on Rails and trying to learn from http://ruby.railstutorial.org/ I'm creating sample_app and got stuck at chapter 6.
My Ruby version: ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
My Rails version: Rails 4.0.0
I have following line in my GemFile:
gem 'bcrypt-ruby', '~> 3.0.0'
If I type gem list bcrypt-ruby , it shows bcrypt-ruby (3.0.1) . But if I try to create user, I get error saying
You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install
I searched a lot on rails website, bcrypt website & even stackoverflow. But, nothing worked. Please help.
I've faced this issue recently (as have many others). As per ladyruby723 posted here, use gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt' in your gemfile file.
I solved this the same problem by the following line:
gem 'bcrypt-ruby', '~> 3.1.2'
I believe this exact issue is solved in another question. There are actually two error messages produced, this being the higher level one, by searching for the lower level I found the below answer.
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile
add below in gem file
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
and run bundle install and restart server
Finally... Got it working. I didn't understand the exact issue but I made two important changes. I'm not sure which change made it working.
I uninstalled my old ruby & rails that were installed from railsinstaller. Installed just ruby for my OS (64 bit which I was not able to choose while installing from railsinstaller). Then I installed rails, sqlite3 separately.
Another important change I did is in Gemfile.lock. I think this did the trick. I kept both of the following lines
bcrypt-ruby (3.0.0)
bcrypt-ruby (3.0.0-x86-mingw32)
In my case, the problem was that bcrypt version 3.1.2 was outdated. Fortunately Ruby has a way of installing the most up to date version of a particular gem right from your command line. In this case I typed in
bundle pristine bcrypt
but more generally you can do
bundle pristine gem name
If you think you might be running into a similar issue with a different gem
I work with Ruby 1.9.3 on Windows.
**I have a trouble to do "bundle install" due to a "thin" gem, for my app.
My original GEMFILE looks like this:
gem "sinatra"
gem "mogli"
gem "json"
gem "httparty"
gem "thin"
Running "bundle install" causes Installing eventmachine (0.12.10) with native extensions which fails. Error is described here: Cannot install thin on windows
Just to mention that "gem install thin" is successful!
Some people on the net, facing this issue, suggested to install
"eventmachine" version 1.0.0.beta.4.1 which I did:
gem list --local shows eventmachine (1.0.0.beta.4.1 x86-mingw32, 1.0.0.beta.2 x86-mingw32)
Yet "bundle install" fails.
In another post: ROR 3.1: Bundle update fails (eventmachine gem)
I followed the advise to specify the exact version of "eventmachine" in GEMFILE, so I edited it like (hopefully I did it right)
gem "sinatra"
gem "mogli"
gem "json"
gem "httparty"
gem "eventmachine" "1.0.0.beta.4.1"
gem "thin"
Now, "bundle install" fails with a different error:
Could not find gem 'eventmachine1.0.0.beta.4.1 (>= 0) ruby' in any of the gem sources listed in your Gemfile.
As I mentioned, this version was successfully installed, and it appears in the local repository.
Please help to make "bundle" "happy" with the right 'eventmachine' version.
Sorry if I missed something basic, or failed to find answer already published.
I think you are missing a comma in this line of the last Gemfile:
gem "eventmachine", "1.0.0.beta.4.1"