Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile - gemfile

Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
Ruby '2.3.3'
gem 'rails', '~> 5.2.1'
gem 'bootstrap-sass', '3.3.7'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'duktape'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
#gem 'redis', '~> 4.0'
gem 'bcrypt', '3.1.12'
#gem 'mini_magick', '~> 4.8'
#gem 'capistrano-rails', group: :development
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
end
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
end
group :test do
gem 'rails-controller-testing', '1.0.2'
gem 'minitest', '5.10.3'
gem 'minitest-reporters', '1.1.14'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
group :production do
gem 'pg', '0.18.4'
end
gem 'tzinfo-data', platforms: [:mingw,:mswin,:x64_mingw, :jruby]
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
uby '2.3.3'
gem 'rails', '~> 5.2.1'
gem 'bootstrap-sass', '3.3.7'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'duktape'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
#gem 'redis', '~> 4.0'
gem 'bcrypt', '3.1.12'
#gem 'mini_magick', '~> 4.8'
#gem 'capistrano-rails', group: :development
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
end
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
end
group :test do
gem 'rails-controller-testing', '1.0.2'
gem 'minitest', '5.10.3'
gem 'minitest-reporters', '1.1.14'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
group :production do
gem 'pg', '0.18.4'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

You probably have a previous DATABASE_URL environment variable set that is pointing to postgres db. DATABASE_URL overrides RAILS_ENV.
One option is to exit your session and try again in a new session if you haven't set permanent DATABASE_URL
unset your DATABASE_URL and you should be good.

"gem install pg" on the command line worked for me

Related

I cant deploy the middleman project

this is the gem file
source 'https://rubygems.org'
gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby, :x64_mingw]
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw, :x64_mingw]
gem "middleman-blog", "~> 4.0"
# Other gems
gem 'middleman-deploy', '~> 2.0.0.pre.alpha'
gem 'middleman-syntax', '~> 3.0'
gem 'redcarpet', '~> 3.4'
gem 'nokogiri', '~> 1.8', '>= 1.8.2'
gem 'builder', '~> 3.2', '>= 3.2.3'
gem 'bootstrap', '~> 4.0.0.beta2.1'
gem 'font-awesome-sass', '~> 4.7.0'
gem 'rails-assets-jquery', source: 'https://rails-assets.org'
gem 'rails-assets-popper.js', source: 'https://rails-assets.org'
gem 'rails-assets-modernizr', source: 'https://rails-assets.org'
How can I fix that! I cant deploy this What is the problem over here!
lol :smile: You have to build before
middleman build
middleman deploy
Just as an additional note (since I don't have enough reputation to comment) — you can configure middleman-deploy to automatically build the site each time you deploy by adding deploy.build_before = true in your config.rb, like this:
activate :deploy do |deploy|
deploy.deploy_method = :git
deploy.remote = 'https://github.com/your-username/your-repository.git'
deploy.branch = 'main' # (or whatever your branch is; presumably you've already got this set up)
deploy.build_before = true
end

Could not find Turbolinks

I have used the installer from rubyinstaller.org. But I get this error afterwards
Could not find gem 'turbolinks (~> 5) x86-mingw32' in any of the gem sources listed in your Gemfile.
I have tried some of the advices in the threats with a similar error, but no luck. Can someone guide in the right direction?
My gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name| repo_name =
"#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git" end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.3'
# Use sqlite3 as the database for Active Record gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
# Use Puma as the app server gem 'puma', '~> 3.7'
# Use SCSS for stylesheets gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported \runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' gem
'turbolinks-source', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do # Call 'byebug' anywhere in the code to
stop execution and get a debugger console gem 'byebug', platforms:
[:mri, :mingw, :x64_mingw] # Adds support for Capybara system
testing and selenium driver gem 'capybara', '~> 2.13' gem
'selenium-webdriver' end
group :development do # Access an IRB console on exception pages or
by using <%= console %> anywhere in the code. gem 'web-console', '>=
3.3.0' end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Could not find gem 'sass-rails (~> 4.0.3) x64-mingw32' in any of the gem sources listed in your Gemfile

Want to start rake command but get this problem
Could not find gem 'sass-rails (~> 4.0.3) x64-mingw32' in any of the gem sources listed in your Gemfile
Run bundle install to install missing gems.. Here is my gemlist
source 'https://rubygems.org'
gem 'rails', '4.1.4'
gem 'json','~> 1.8.1'
gem 'mongo','~>2.5'
gem "haml-rails", "~> 1.0"
gem "sass-rails",'~> 4.0.3'
gem 'jquery-rails', '~> 3.1.1'
gem 'jquery-ui-rails', '~> 5.0.0'
gem 'cgminer_api_client', '~> 0.2.3'
gem 'cgminer_monitor', '~> 0.2.18'
gem 'rake', '~> 10.3.2'
gem 'therubyracer', '~> 0.12.1'
gem 'thin', '~> 1.6.2'
gem 'uglifier', '~> 2.5.3'
group :development do
gem 'pry'
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rack', '2.0.1'
gem 'rspec'
source 'https://rubygems.org'
gem 'nokogiri'
end
If i tring to get bundle install it's installing corectly, but when i'm tring to strt rake this problem appears again

Jekyll errors when starting the server

I'm running Octopress/Jekyll on Ubuntu.
When I do the following command:
$ bundle exec rake generate preview
I get the following error:
/var/lib/gems/2.3.0/gems/liquid-2.5.5/lib/liquid/htmltags.rb:43:
warning: key "index0" is duplicated and overwritten on line 46
Configuration file: /home/alex/Code/octopress/_config.yml
Source: source
Destination: public
Generating...
jekyll 2.0.0 | Error: undefined method `extname' for
#<Jekyll::StaticFile:0x00000003482d78>
Here is my Gemfile:
source "https://rubygems.org"
group :development do
gem 'rake', '~> 10.0'
gem 'jekyll', '~> 2.0'
gem 'octopress-hooks', '~> 2.2'
gem 'octopress-date-format', '~> 2.0'
gem 'jekyll-sitemap'
gem 'rdiscount', '~> 2.0'
gem 'RedCloth', '~> 4.2.9'
gem 'haml', '~> 4.0'
gem 'compass', '~> 1.0.1'
gem 'sass-globbing', '~> 1.0.0'
gem 'rb-fsevent', '~> 0.9'
gem 'stringex', '~> 1.4.0'
gem 'pygments.rb'
gem 'maruku'
end
gem 'sinatra', '~> 1.4.2'
Anyone got any ideas?
Thanks in advance!
I've resolved these errors by updating my Gemfile to:
source "https://rubygems.org"
group :development do
gem 'rake', '~> 10.0'
gem 'jekyll', '~> 3.4'
gem 'octopress-hooks', '~> 2.2'
gem 'octopress-date-format', '~> 3.0'
gem 'jekyll-sitemap'
gem 'rdiscount', '~> 2.0'
gem 'RedCloth', '~> 4.2.9'
gem 'haml', '~> 4.0'
gem 'compass', '~> 1.0.1'
gem 'sass-globbing', '~> 1.0.0'
gem 'rb-fsevent', '~> 0.9'
gem 'stringex', '~> 1.4.0'
gem 'pygments.rb', '~> 0.6.3'
gem 'jekyll-paginate'
end
gem 'sinatra', '~> 1.4.2'
Note that my pygments.rb gem doesn't seem to work properly - it doesn't highlight the code syntax according to language (i.e. Ruby): it just changes the font family and keeps it in a bland grey colour (instead of highlighting in Ruby colours).
But that's another issue.
For now, the initial errors - at least - are resolved.

Ruby on Rails, Sprockets::FileNotFound, Error compiling CSS asset

I am trying to install Ruby on Rails on my Mac. When I run "Rails s" it runs fine, but when I go to "localhost:3000" in my browser I get the following error:
Error Compiling CSS asset
Sprockets::FileNotFound: Couldn't find file 'unify/sliders/revolution/bg-text.png'
(in /Users/user1/project/app/assets/stylesheet/unify/plugins.css.erb)
/Library/Ruby/Gems/2.0.0/gems/sprockets-2.10.1/lib/sprockets/base.rb:153:in `resolve'
My gemfile looks like this:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.5'
gem 'meta-tags'
gem 'pg'
group :production do
gem 'rails_12factor'
end
group :development do
gem 'sqlite3'
end
group :development do
# gem 'better_errors'
# gem 'binding_of_caller'
# gem 'pry'
# gem 'sprockets_better_errors'
gem 'rails-dev-tweaks', '~> 1.1'
gem 'thin'
end
gem 'dotenv-rails', :groups => [:development, :test]
gem 'sass-rails', '~> 4.0.0'
gem 'compass-rails'
gem 'font-awesome-sass'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer'
gem 'less-rails' #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'twitter-bootstrap-rails', :github => 'seyhunak/twitter-bootstrap-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'unicorn'
gem 'community_engine', :git => 'https://github.com/bborn/communityengine.git', :branch => :rails4
gem 'bootstrap_form'
gem 'omniauth-facebook', '~> 1.6.0'
gem 'omniauth-twitter'
gem 'json'
gem 'rest-client'
gem 'authlogic', '3.4.0'
gem 'jquery-datatables-rails', '~> 2.2.1'
gem 'gmaps4rails'
gem 'underscore-rails'
gem 'twitter', '~> 5.9.0'
gem 'feedjira', :git => 'https://github.com/feedjira/feedjira.git'
gem 'nokogiri', '>= 1.5'
gem 'sidekiq'
gem 'whenever', :require => false
gem 'bootstrap-kaminari-views'
gem 'factual-api'
gem 'activerecord-import'
gem 'treat', github: 'louismullie/treat'
gem 'engtagger'
gem 'jqcloud-rails'
gem 'embedly'
gem 'yaml_db', github: 'jetthoughts/yaml_db', ref: 'fb4b6bd7e12de3cffa93e0a298a1e5253d7e92ba'
gem 'acts_as_follower'
gem 'acts_as_votable', '~> 0.9.0'
gem 'impressionist'
gem 'youtube_it', github: 'jsh-c/youtube_it'
gem 'open_uri_redirections'
gem 'aws-sdk'
gem 'momentjs-rails', '2.7.0'
gem 'bootstrap-daterangepicker-rails', :git => 'https://github.com/jordanbrock/bootstrap-daterangepicker-rails.git', :branch => :rails4
gem 'axlsx_rails'
gem 'zip-zip'
gem 'to_csv-rails', :git => 'git://github.com/liangwenke/to_csv-rails.git'
gem 'newrelic_rpm', group: :production
gem 'seed-fu', '~> 2.3'
gem 'mongo'
gem 'bson_ext'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'jquery-turbolinks'
gem 'tweetstream'
gem 'sitemap_generator'
gem 'ckeditor'
gem 'rails-i18n', '~> 4.0.0' # For 4.0.x
I appreciate the help!

Resources