How to install activerecord-sqlserver-adapter (~> 4.0.0)? - ruby-on-rails-4

I have a Rails 4 project and use activerecord-sqlserver-adapter. The readme installation suggests:
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter', '~> 4.0.0'
However, bundle install returns:
Resolving dependencies...
Could not find gem 'activerecord-sqlserver-adapter (~> 4.0.0) ruby' in the gems available on this machine.
rubygems.org show the latest version as 3.2.12. How can I bundle install version ~> 4.0.0 as 3.2.12 only supports ActiveRecord 3.x?

Why not just Source version 4.0.0 of activerecord-sqlserver-adapter directly from Github.
In Gemfile
Replace
gem 'activerecord-sqlserver-adapter', '~> 4.0.0'
With
gem 'activerecord-sqlserver-adapter', '~> 4.0.0', :git => "git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git"

They have not provided support for Rails 4 yet, you can try below gem to obtain same thing.
sudo gem install sic-activerecord-sqlserver-adapter
This will work with Rails 4 definitely, i have tried this. thanks.

It says that the adapter is missing.
You should install ruby-odbc and it should work.
gem 'ruby-odbc', '0.99995'

Related

Could not find generator 'mongoid:config'. When rails generate mongoid:config

I'm new to Ruby on Rails.I've been trying generate mongoid.yml file to connect with mongodb. but im getting this error:
`Could not find generator 'mongoid:config'.
Did you mean? mongoid:devise
Run `bin/rails generate --help` for more options.`
This is my Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.1.3"
gem 'mongoid'
gem 'jquery-rails'
gem 'devise'
gem 'figaro'
gem 'haml-rails'
gem 'haml'
gem "bson"
gem "moped", github: "mongoid/moped"`
gem 'nokogiri'
gem 'kaminari'
gem 'rack-contrib'
gem 'soulmate', require: 'soulmate/server'
gem 'carrierwave'
gem 'carrierwave-mongoid', require: 'carrierwave/mongoid'
gem 'colorize'
gem 'typhoeus'
gem 'execjs'
gem 'roo'
gem 'addressable', require: 'addressable/uri'
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem "passenger",require: "phusion_passenger/rack_handler"
I tried adding these to Gemfile. But not working.
gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml' gem "active_model_serializers", require: true gem 'activemodel-serializers-xml' gem 'active_model_serializers'
I have noticed gem moped is kind of old for this version of mongoid. Please help if anyone
Thank you in advance!
moped is an out of date (legacy) version of the MongoDB Ruby Driver.
When you add the mongoid gem to your Gemfile, it will automatically pull in the version of the driver (mongo) that matches the dependency in the gemspec (ex: https://github.com/mongodb/mongoid/blob/v8.0.3/mongoid.gemspec#L41).
Removing moped from your Gemfile and re-running bundle install should do the trick ;)

Activeadmin bundle error

I am having this error when trying to bundle install. From what I understand it says activeadmin gem depends on metasearch 0.9.2 and metasearch gem depends on activerecord 3.1.0 but rails 4.1.0 depends on activercod 4.1.0. so what is my course of action for this?
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
activeadmin (>= 0) ruby depends on
meta_search (>= 0.9.2) ruby depends on
activerecord (~> 3.0.0.rc2) ruby
rails (= 4.1.0) ruby depends on
activerecord (4.1.0)
We're currently working on 1.0.0, which as far as dependencies, moves
us from meta_search to Ransack and adds Rails 4 support. You can get
Rails 4 and 4.1 support by tracking master:
gem 'activeadmin', github: 'activeadmin'
https://github.com/activeadmin/activeadmin

ActiveAdmin: gem not checkout, run bundle install first

In a Rails 4 app, I am trying to use ActiveAdmin 1.0.pre2. bundle install doesn't complain and seems to have included the gem and it works properly.
I am having this in my gem file:
gem 'activeadmin', github: 'gregbell/active_admin'
$> bundle show activeadmin
/home/aslam/.rvm/gems/ruby-2.1.0#monaeo/bundler/gems/active_admin-3fb7f03335b1
Even after running bundle install several times, I keep getting the following error:
git://github.com/gregbell/active_admin.git (at master) is not yet checked out.
Run `bundle install` first.
I am using
Bundler version 1.6.0.rc2 (upgraded from 1.5.3)
Ruby: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
Rails: 4.0.4
I am not sure what is going wrong here?
Try to install a prerelease version of Bundler:
gem install bundler --pre
It should solve the problem.
Use following in the Gemfile
gem 'activeadmin', :git => "git://github.com/gregbell/active_admin.git"
This way when you run bundle install, activeadmin would be sourced from its github repository.
Two things
A. You need to include like this in the gem file since 0.6.x is stable and maintained.
gem 'activeadmin', github: 'gregbell/active_admin', branch: '0-6-stable'
B. You can give a try by forking from the stable version of activeadmin
My solution:
rake rails:update:bin
bundle install

Why is uglifier gem in default Rails Gemfile still of version 1.3.0?

When creating a new Rails 4 app the default Gemfile has this in the gem list:
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
This despite that the last official version of uglifier being 2.4.0
Am I missing something here or why the discrepancy in versions?
The bundler version specifier '>= 1.3.0' means at least version 1.3.0 should be accepted. In other words, using the current version 2.4.0 is just fine.
In fact, that's the installed version you're going to have when starting a new application from scratch. Just check your Gemfile.lock file for the actual installed versions of gems in your bundle. You'll probably find something like this:
uglifier (2.4.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
Which means you have uglifier 2.4.0.
More info: http://guides.rubygems.org/patterns/#pessimistic_version_constraint

Rails 4: activeadmin error message - Bundler could not find compatible versions for gem "actionpack"

I want to use activeadmin for my rails project, so I added it to my gemfile.
gem 'activeadmin'
and updated the bundle, but received this error message -
Resolving dependencies...
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
activeadmin (>= 0) ruby depends on
actionpack (~> 3.0.0.rc2) ruby
rails (= 4.0.0) ruby depends on
actionpack (4.0.0)
I uploaded the project in github; this is the link of the gemfile - https://github.com/Mashpy/esl/blob/master/Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
#gem
gem 'activeadmin'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
What am I doing wrong that is preventing me from adding activeadmin?
Active Admin has a few other dependencies as well. Check this out Active Admin install with Rails 4.
Copy and paste all the gems (in the top answer) to your gemfile and you should not have any issues running bundle.
You can update your bundle using -
bundle update
Then
bundle install
To make sure your configuration of the gems are right.
I think you should upgrade these gems :
sass-rails ~> 3.2.3
coffee-rails ~> 3.2.1
References:
http://guides.rubyonrails.org/3_2_release_notes.html