I know this question has been answered a million times on SO, but I can't seem to find the right combination of things to fix my dilemma.
This is the error I'm getting:
An error occurred while installing sqlite-ruby (1.2.5), and Bundler cannot continue.
Make sure that 'gem install sqlite3-ruby -v '1.2.5'' succeeds before bundling.
Failed to install gems via bundler.
Detected sqlite gem that is not supported on Heroku
I already have Postgres installed on my laptop, and my Gemfile is as follows:
source 'https://rubygems.org'
gem 'rails', '4.0.3'
gem 'sqlite3-ruby', '1.2.5'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass'
group :doc do
gem 'sdoc', require: false
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Anyone have insight on what I'm doing wrong? I already made sure that my changes are committed via "bundle install" and "bundle".
Simply remove the line
gem 'sqlite3-ruby', '1.2.5'
because you already have the gem sqlite in development and test environments, run bundle install, and you should be good to go!
Related
I tried to run rails s but sudently I'm getting an error message:
/home/leiver/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- sass (LoadError)
from /home/leiver/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /home/leiver/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from
.....
I know that there's something about sass about how it's going to disapear or something and I don't know if it's linked
Thanks if you can help :)
EDIT
here's my full Gemfile:
source 'https://rubygems.org'
ruby '2.4.5'
gem 'bootsnap', require: false
gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'rails', '5.2.1'
gem 'redis'
gem 'autoprefixer-rails'
gem 'bootstrap-sass', '~> 3.3'
gem 'font-awesome-sass', '~> 5.0.9'
gem 'sassc-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'devise'
gem 'money-rails'
gem "pundit"
group :development do
gem 'web-console', '>= 3.3.0'
end
group :development, :test do
gem 'pry-byebug'
gem 'pry-rails'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'dotenv-rails'
end
Have tried bundle or bundle install before running the rails s.
Still not working try to replace that gem with thisgem 'sassc' and bundle or just do gem install sassc
Ok so I couldn't resolve the problem, so I deleted my local directory and re-cloned it from GitHub.
I don't know if it's good practice but it resolved the problem for me, so if anyone else is having this issue and don't find a proper solution, try doing that.
The problem may be exists in gems. The problem founded by OP (and described in his answer) appears in the application files. However same problem problem may be caused in gems. The same problem in gems with same reason has identical solution.
In details. The problem during installation or some else may corrupt some gem so it is visible as installed but actually has missed or corrupted files. Check before that hard drive has enough free space.
So solution is fully reinstall bundle gems:
bundle install --force
I deleted all of the files within the tmp folder.
And it worked!
When I install the gem ipa_reader the code does not install correctly. In the file /lib/ipa_reader/ipa_file.rb, the code that I get is
Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) } .
Which I guess is from an older version.
What I should get, and what shows up on github is
Zip::File.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) }.
What is going on?
Gemfile
source 'https://rubygems.org'
gem 'rails', '4.1.4'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development do
gem 'spring'
gem 'pry-rails'
end
gem 'CFPropertyList', '~> 2.1.1'
gem 'rubyzip'
gem 'aws-sdk'
gem 'rufus-scheduler'
gem 'omniauth-google-oauth2'
gem 'figaro'
gem 'ipa_reader' , '~> 0.7.1'
When you are installing from rubygems you are downloading stable 0.7.1 version, while at github there is latest development version. If you want to use this one (although it is not recommended to live on the bleeding edge), specify git url in your gemfile
gem 'ipa_reader', git: 'https://github.com/schlu/Ipa-Reader.git'
refer here for more info http://bundler.io/v1.3/git.html
This looks like a mistake from the gem author.
A github repo is not synched to rubygems, so the gem published to rubygems does not necessarily have to be the exact same thing as on github.
You can easily tell bundler to user the code from github, by doing:
gem 'ipa_reader', github: 'schlu/Ipa-Reader'
I do not have sqlite installed I am using pg here is my gemfile:
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'jquery-turbolinks'
gem 'momentjs-rails'
gem 'font-awesome-rails'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
gem 'devise'
gem 'turbolinks'
gem 'omniauth-facebook'
gem 'jbuilder', '~> 2.0'
gem 'paperclip', '~> 4.1'
gem 'geoip'
gem 'ziptastic'
gem 'rest-client', '~> 1.7.2'
group :test, :development do
gem 'guard'
gem 'guard-livereload'
gem 'spring'
gem 'rspec-rails', '~> 3.0.0'
gem 'meta_request'
end
I deleted gemfile.lock and ran bundle. For some reason sqlite3 (1.3.9) is appearing in my gemfile.lock...
According to Heroku https://devcenter.heroku.com/articles/bundler
Running bundle install also generates a Gemfile.lock file, which
should be added to your git repository. Gemfile.lock ensures that your
deployed versions of gems on Heroku match the version installed
locally on your development machine.
Why is gemfile.lock showings sqlite3 if it's not in my Gemfile and how do I fix this? Thanks! =)
The problem I had was the gem ziptastic has a sqlite3 dependency which is why my gemfile.lock was including sqlite3. If you're having a similar issue I suggest you check the dependencies of each gem.
I'm trying to run rails g active_admin:install script after installing of activeadmin gem. When I run this script I get an error
Could not find arbre-1.0.1 in any of the sources
Run `bundle install` to install missing gems.
Although I've already installed all necessary gems and my app is using arbre gem:
Using arbre 1.0.1
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'devise'
gem 'activeadmin', github: 'gregbell/active_admin'
How can I fix that problem? Thanks!
Take a look at https://github.com/gregbell/active_admin/issues/3216. Although the cause of the problem is not mentioned they recommend deleting Gemfile.lock and running bundle install again.
The problem is the wrong gemset for the app. For me solution was rvm use 2.1.1#your_gemset and restarting terminal
I am developing a rails application in Mac after switching over from Windows. I thought that I had installed everything correctly. The IDE I'm using is Rubymine.
I receive numerous error messages when the rake command is run at the start of a new application. The cause is:
/Users/johncase/.gem/ruby/2.0.0/gems/bundler-1.5.1/lib/bundler/resolver.rb:302:in `resolve': Could not find gem 'sdoc (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
I have installed sdoc multiple times through different methods, but I keep receiving the error. I have researched this problem and found many answers that have not worked.
I've tried: 'http://rubygems.org' instead of 'https://rubygems.org' then a bundle install with no success.
I've tried deleting the Gemfile.lock then bundle installing with no success.
Perhaps the answer is obvious, but I cannot seem to find it. Any assistance with this problem would be much appreciated.
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.0.2'
gem 'mysql2'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
This is because the gem is installed, but not being required. You either need to remove the require: false in the Gemfile or require it manually in your rake task. There is a lengthy explanation of this here: Bundler: What does :require => false in a Gemfile mean?