I can't install refile gem from cloned repo on my local.
in my Gemfile:
gem "refile", require: "refile/rails"
gem "refile-mini_magick"
and after running bundle install --without production
i got this error:
Any help?
Check ruby current and default version. rvm list
Make default your ruby 2.2.3 version rvm use 2.2.3 --default
Close terminal and go back to your project directory.
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.
When I run cap production deploy I get the following error:
cap production deploy
SSHKit::Command::Failed: ruby exit status: 2
ruby stdout: Nothing written
ruby stderr: Ruby ruby-2.4.0 is not installed
I specified the Ruby version in my deploy.rb file:
set :passenger_restart_with_touch, true
set :rvm_ruby_version, 'ruby-2.4.0'
and included it in my Gemfile:
gem "capistrano", "~> 3.8"
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rvm'
gem 'capistrano-passenger'
How should I run Ruby version 2.4.0 on the server without going into the server?
You need to run this on server:
rvm install 2.4.0
Install the Ruby version on the server using
rvm install 2.4.0
and then, in your app's root path, use the installed Ruby:
rvm use 2.4.0
i am using ruby 1.8.7 and rails 3.0.12 for my project.
when i run "bundle install", i get the following error.
Gem::InstallError: linecache19 requires Ruby version >= 1.9.2.
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
i don't want to change my ruby version.
You can try using the debugger gem instead of ruby-debug. Check out your gemfile and replace gem "ruby-debug" with gem "debugger". From memory that's how I did it.
Replacing gem 'ruby-debug19' with gem 'ruby-debug' worked for me.
I am in an older Rails project that has a Gemfile. I tried to add a gem to the Gemfile and bundle install but got an error:
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 3.0.0) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.1.5)
This Gemfile requires a different version of Bundler.
The version of Rails it's using requires bundler ~>1.0.0 but I have 1.1.5 installed and am using it for my other projects. Usually I would use bundle exec ... but since this is bundler we are talking about, it's a little more complicated than that. How can I add a gem to my Gemfile and run bundle install while using the version of bundler that it requires?
First you need to install the appropriate version of bundler:
% gem install bundler -v '~> 1.0.0'
Successfully installed bundler-1.0.22
Then force rubygems to use the version you want (see this post):
% bundle _1.0.22_ install
This is what I had to do to get it to work to install with a previous version (2.2.11) of bundler:
gem install bundler:2.2.11
bundle _2.2.11_ install
The error message In Gemfile: bundler (~> 1.16) is a bit inaccurate, since the version number requirement can come from other places, such as the .gemspec file, which was the case for me:
spec.add_development_dependency "bundler", "~> 1.16"
Removing the version number from the .gemspec file solved the issue for me:
spec.add_development_dependency "bundler"
I had the same issue on macOS Mojave. I installed the different version of the bundler gem and uninstall the current version.
gem install bundler -i '2.0.1'
gem uninstall bundler
Then gives me the option to choose the version to uninstall and I choose the one which is creating the problem.
If you use rvm to manage your ruby versions consider using gemsets for projects. This way you can install the specific version of bundler needed without having to specify the version each time.
You can confirm your gemset is loaded by running rvm info in your project directory.
Now you can install the version of bundler you'd like via gem install bundler -v '~> <VERSION>'. The next time you need to use bundler just run bundle.
I need to use addressable 2.2.4 gem, but I have 2.2.5 version (because of an issue discussed here: https://github.com/sporkmonger/addressable/pull/33). I tried:
source 'http://rubygems.org'
source 'http://gems.github.com'
gem "addresable", "2.2.4"
bundle install
and get Could not find gem 'adressable (= 2.2.4, runtime)' in any of the gem sources listed in your Gemfile.
If I install/uninstall gem manually by
sudo gem install addressable -v 2.2.4
sudo gem uninstall addressable -v 2.2.5
I get the same error.
So, how can I force 2.2.4 version for my app?
You've misspelled "addressable" in your gem line.
Your bundle might be locked at 2.2.5 — try running bundle update. It's counter-intuitive, but it'll rebuild your Gemfile.lock with the specified version.
You don't need gems.github.com as a source anymore — they quit building it and recommend rubygems.org.