trying to integrate Community Engine into my app - ruby-on-rails-3

error
Bundler could not find compatible versions for gem "multi_json":
In Gemfile:
community_engine (>= 0) ruby depends on
multi_json (~> 1.0.0) ruby
uglifier (>= 1.0.3) ruby depends on
multi_json (1.3.6)
Gemfile
gem 'rails', '3.2.6'
gem 'sqlite3'
gem 'json'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'community_engine', :github => 'bborn/communityengine', :branch => 'rails3'
doubt
always gives the same error despite of following all the instructions in the README FILE of the community engine

add gem "multi_json" in Gemfile
delete the Gemfile.lock file
And then run bundle install
This helped me to overcome the above error.

Related

Bundle Update could not find dependencies while upgrading Rails app from 4.0 to 5.0

I am trying to upgrade my existing Rails 4.2 application to Rails 5.0. Have changed the Rails gem to 5.0.2 in Gemfile as below.
source "https://rubygems.org"
gem "rake", "~> 0.9.2"
#gem "rails", "~> 4.2.7.1"
gem 'rails', "~> 5.0.1"
gem "mysql2"
gem "mime-types", "~> 1.16", require: "mime/types"
gem "rubyzip", "~> 1.1.0"
gem "nokogiri", "1.6.8".
gem "apn_on_rails", "0.4.1", git:"https://bitbucket.orgsheridangroupapn_on_rails.git"
gem "gdata_19", "~>1.1.5"
gem "gcm_on_rails", "0.2.1", git: "https://bitbucket.org/sheridangroup/gcm_on_rails"
gem "open4", "1.0.1"
gem "rmagick", "2.13.2", require: "RMagick"
gem 'aws-sdk-v1' #aws-sdk v1 is used for url signing, as v2 has a one-week expiration limit
gem 'aws-sdk', '~> 2'
gem "libxml-ruby", "~> 2.7.0", require: "libxml"
gem "bitly", "0.10.0"
gem "uuid", "~> 2.3.7"
gem "htmlentities", "4.3.4"
gem "paper_trail", "~> 6.0.2"
gem "mechanize"
gem "rbtree", "0.4.2"
gem "resque"
gem "yajl-ruby" # For resque
gem "json", "~> 1.8.3"
gem "minitest"
gem "will_paginate"
gem "configatron", "~> 2.13.0"
gem "american_date", "~> 1.1.0"
gem "builder"
gem "coderay"
gem "json-schema"
gem "rspec"
gem "jquery-rails", "~> 4.2.2"
gem "jquery-ui-rails"
gem 'jquery-timepicker-addon-rails'
gem 'bcrypt', '~> 3.1.7'
gem "net-ftp-list"
gem 'recursive-open-struct'
gem 'slim'
gem 'paranoia'
gem 'typhoeus'
gem 'bundler', '1.12.5'
gem "paperclip", "~> 4.3.7"
group :test do
#gem 'spork-rails'
gem 'capybara'
gem 'poltergeist'
gem 'simplecov', require: false
gem 'simplecov-rcov', require: false
gem 'timecop'
gem 'test-unit'
end
# Used for NewRelic monitoring in Staging env only
group :staging, :production do
gem "newrelic_rpm"
gem "ey_config"
end
group :test, :development do
gem "rspec-rails", require: false
gem "listen", ">= 0.5.1", require: false
gem "machinist", "~> 2.0", require: false
gem "database_cleaner", "~> 0.9.1", require: false
gem 'pry-byebug'
end
group :development do
# <browser-debugging-tools>
gem "better_errors"
gem "binding_of_caller"
gem "meta_request"
# </browser-debugging-tools>
gem 'quiet_assets' # prevent assets pipeline logging
gem 'rubocop', '0.35.0'
end
group :assets do
gem "sass-rails"
gem "coffee-rails"
gem "uglifier", "2.7.2"
end
Tried running bundle update , but got the following error in the console.
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
actioncable (= 5.0.1) was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) was resolved to 5.0.1, which depends on
rack (~> 2.0)
better_errors was resolved to 2.1.1, which depends on
rack (>= 0.9.0)
capybara was resolved to 2.12.1, which depends on
rack (>= 1.0.0)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
actioncable (= 5.0.1) was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) was resolved to 5.0.1, which depends on
rack-test (~> 0.6.3) was resolved to 0.6.3, which depends on
rack (>= 1.0)
resque was resolved to 1.27.2, which depends on
sinatra (>= 0.9.2) was resolved to 1.1.0, which depends on
rack (~> 1.1)
sass-rails was resolved to 5.0.6, which depends on
sprockets (< 4.0, >= 2.8) was resolved to 3.7.1, which depends on
rack (< 3, > 1)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.0.1)
quiet_assets was resolved to 1.0.0, which depends on
rails (~> 3.1)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails was resolved to 4.2.1, which depends on
railties (< 5.2.x, >= 4.0.0)
jquery-rails (~> 4.2.2) was resolved to 4.2.2, which depends on
railties (>= 4.2.0)
jquery-timepicker-addon-rails was resolved to 1.4.1, which depends on
railties (>= 3.1)
quiet_assets was resolved to 1.0.1, which depends on
railties (~> 3.1)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
railties (= 5.0.1)
I want to move on in upgrading to Rails 5.0. Can I get a direction to fix all the errors.
rspec-rails was resolved to 3.5.2, which depends on
railties (>= 3.0)
sass-rails was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
Delete your Gemfile.lock file and try updating once again.

Why is bundle update taking so long?

I am upgrading my Rails app to use Ruby 2.1 and am updating my gems. However, when I run bundle update it is taking an incredibly long time to complete (3+ hours on the last run).
Any suggestions for fixing this would be greatly appreciated.
Here is my current gemfile:
source 'http://rubygems.org'
gem 'rails', '~> 3.2.11'
gem 'mysql2', '~>0.3.10'
gem 'json', '1.7.7'
gem 'will_paginate', '~> 3.0'
gem 'carrierwave'
gem "fog", "~> 1.3.1"
gem 'gibbon'
gem 'nokogiri'
gem 'premailer-rails3'
gem 'pg'
gem 'aws-s3'
gem 'amazon-ec2'
# Use unicorn as the app server
gem 'unicorn'
gem 'sidekiq'
gem 'rufus-scheduler'
gem 'exception_notification'
gem 'haml', '>= 4.0.0.rc.1'
gem 'html2haml'
gem 'state_machine'
gem 'garb', :git => 'git://github.com/Sija/garb.git'
gem "activerecord-import", ">= 0.2.0"
gem "hashie"
gem 'draper', '~> 1.0'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'airbrake'
gem 'newrelic_rpm'
gem 'devise', '~> 2.2.4'
gem 'acts_as_tenant', :git => 'git://github.com/ErwinM/acts_as_tenant.git'
gem 'bourbon'
gem 'sass'
gem 'neat'
gem 'bitters'
gem 'middleman'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'handlebars_assets', :git => 'git://github.com/leshill/handlebars_assets.git'
gem 'jquery-rails', '~> 2.0.1'
gem 'uglifier', '>= 1.0.3'
end
group :test do
#gem 'webmock'
gem 'vcr'
gem 'launchy'
gem 'database_cleaner'
gem 'capybara', '2.0.0'
gem 'shoulda'
end
group :development, :test do
gem 'faker'
gem "rspec-rails", "2.14.0"
gem "factory_girl_rails", "~> 4.0", :require => false
gem 'spork', '~> 1.0rc'
gem 'guard-livereload'
gem 'guard-jasmine'
gem 'guard-spork'
gem 'guard-rspec'
gem 'jasminerice', :git => 'git://github.com/bradphelan/jasminerice.git'
end
group :development do
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
gem 'rb-fchange', :require => false
gem 'pry'
end
Here is the last result I received:
Bundler could not find compatible versions for gem "thor":
In Gemfile:
rails (~> 3.2.11) ruby depends on
railties (= 3.2.11) ruby depends on
thor (< 2.0, >= 0.14.6) ruby
jquery-rails (~> 2.0.1) ruby depends on
thor (0.14.0)
You're including gems with incompatible dependencies. You cannot have both jquery-rails ~> 2.0.1 and rails ~> 3.2.11 as they have mutually exclusive requirements for versions of the Thor gem.
I would recommend removing the explicit version requirement for jquery-rails let Rails choose the version it needs based on its dependencies.

.worker file with `gemfile "Gemfile", "group"` increases remote build time x10

To better manage the required gems across my application, I created a Gemfile group called :iron:
group :default, :iron do
  gem "activerecord", require: 'active_record
  gem 'mysql2'
  gem 'aws-sdk'
  gem 'yajl-ruby'
  gem 'hashie'
  gem 'require_all'
end
This would help consolidate the required gems for iron worker. My .worker file is now as follows:
gemfile '../Gemfile', 'iron'
instead of redundantly listing all the gems individually:
gem "activerecord"
gem 'mysql2'
...
Unfortunately, this increased my remote build time from 1 minute to 10 minutes. The output attempts to include far more gems, seemingly bubbling up nested dependencies:
BEFORE:
------> Creating code package
Found workerfile with path='iron_job.worker'
Detected exec with path='iron_job_bootstrapper.rb' and args='{}'
Merging dir with path='../app/models' and dest=''
Merging dir with path='../lib' and dest=''
Merging file with path='iron.json' and dest=''
Adding ruby gem dependency with name='activerecord' and version='>= 0'
Adding ruby gem dependency with name='mysql2' and version='>= 0'
Adding ruby gem dependency with name='aws-sdk' and version='>= 0'
Adding ruby gem dependency with name='yajl-ruby' and version='>= 0'
Adding ruby gem dependency with name='hashie' and version='>= 0'
Adding ruby gem dependency with name='require_all' and version='>= 0'
AFTER:
------> Creating code package
Found workerfile with path='iron_job.worker'
Detected exec with path='iron_job_bootstrapper.rb' and args='{}'
Merging dir with path='../app/models' and dest=''
Merging dir with path='../lib' and dest=''
Merging file with path='iron.json' and dest=''
Adding ruby gems dependencies from iron group of ../Gemfile
Adding ruby gem dependency with name='i18n' and version='0.6.5'
Adding ruby gem dependency with name='minitest' and version='4.7.5'
Adding ruby gem dependency with name='multi_json' and version='1.8.1'
Adding ruby gem dependency with name='atomic' and version='1.1.14'
Adding ruby gem dependency with name='thread_safe' and version='0.1.3'
Adding ruby gem dependency with name='tzinfo' and version='0.3.37'
Adding ruby gem dependency with name='activesupport' and version='4.0.0'
Adding ruby gem dependency with name='builder' and version='3.1.4'
Adding ruby gem dependency with name='activemodel' and version='4.0.0'
Adding ruby gem dependency with name='activerecord-deprecated_finders' and version='1.0.3'
Adding ruby gem dependency with name='arel' and version='4.0.0'
Adding ruby gem dependency with name='activerecord' and version='4.0.0'
Adding ruby gem dependency with name='json' and version='1.8.0'
Adding ruby gem dependency with name='mini_portile' and version='0.5.1'
Adding ruby gem dependency with name='nokogiri' and version='1.6.0'
Adding ruby gem dependency with name='uuidtools' and version='2.1.4'
Adding ruby gem dependency with name='aws-sdk' and version='1.11.1'
Adding ruby gem dependency with name='bundler' and version='1.3.5'
Adding ruby gem dependency with name='hashie' and version='2.0.5'
Adding ruby gem dependency with name='mysql2' and version='0.3.13'
Adding ruby gem dependency with name='require_all' and version='1.3.1'
Adding ruby gem dependency with name='yajl-ruby' and version='1.1.0'
This output was local, but the time stretched out even more on the IronWorker service because it reinstalls gems more than once (uninstall then reinstalls bundler). The log below has the details.
https://hud.iron.io/tq/projects/5254773dd05880000d000003/tasks/525ee1d9f8953468b927e83f/log
We have since gone back to a .worker file that simply lists out the gems we need rather than invoke gemfile "Gemfile", "iron". Any help on how to use gemfile without reinstalling bundler and have a 10m upload time would be much appreciated!
Thanks.
Edit
Adding full Gemfile. Please note that we have no desire to pull in all the gems on the :default group. That is overkill for our workers. We just want :iron.
Bundler version 1.3.5
source 'https://rubygems.org'
ruby '1.9.3'
gem 'typhoeus' # Only for ruby 1.9.3
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'haml-rails'
gem 'thin-rails'
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'settingslogic'
gem 'iron_worker_ng'
group :default, :iron do
gem "activerecord", require: 'active_record'
gem 'mysql2'
gem 'aws-sdk'
gem 'yajl-ruby'
gem 'require_all'
end
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :production, :qa do
gem 'rails_12factor' #for heroku
end
group :development, :test do
gem 'factory_girl_rails'
gem 'ffaker'
gem 'shoulda-matchers'
gem 'pry'
gem 'debugger', '>= 1.6.1'
gem 'pry-debugger'
gem 'pivotal_git_scripts'
gem 'rspec-rails'
gem 'capybara'
gem 'fuubar'
end
group :test do
gem 'database_cleaner'
end
grouped Gemfile:
source 'https://rubygems.org'
ruby '1.9.3'
group :rails do
gem 'typhoeus' # Only for ruby 1.9.3
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'haml-rails'
gem 'thin-rails'
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'settingslogic'
gem 'rack-mini-profiler'
end
group :rails, :iron do
gem "activerecord", require: 'active_record'
gem 'mysql2'
gem 'aws-sdk'
gem 'yajl-ruby'
gem 'require_all'
gem 'hashie'
gem 'iron_worker_ng'
end
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :production, :qa do
gem 'rails_12factor' #for heroku
end
group :development, :test do
gem 'factory_girl_rails'
gem 'ffaker'
gem 'shoulda-matchers'
gem 'pry'
gem 'debugger', '>= 1.6.1'
gem 'pry-debugger'
gem 'pivotal_git_scripts'
gem 'rspec-rails'
gem 'capybara'
gem 'fuubar'
end
group :test do
gem 'database_cleaner'
end
IronWorker already announced a "Docker Workflow" and you don't need the .worker file anymore. You just need to install all dependencies locally in docker image reproducing the same environment as running on IronWorker servers. Here you can find a ruby "HelloWorld" example.

rake aborted cannot load such file --v8 windows

please help, this is my gemfile. It's an old project i created on ubuntu 12.04, now i'm trying to run it on windows 8.
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise', '2.2.4'
gem 'execjs', :git => 'git://github.com/kennyj/execjs.git', :branch => 'rails_issue_2880'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
#gem 'therubyracer', :platforms => :ruby
gem 'twitter-bootstrap-rails'
gem 'less-rails'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
The command prompt:
C:\Users\manu\Documents\projets\rails\xibart>rake db:migrate
[WARNING] Please install gem 'therubyracer' to use Less.
rake aborted!
cannot load such file -- v8
C:/Users/manu/Documents/projets/rails/xibart/config/application.rb:7:in `<top (r
equired)>'
C:/Users/manu/Documents/projets/rails/xibart/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Uncomment the ruby racer line to install it:
gem 'therubyracer', :platforms => :ruby

rails admin - scss error

I installed rails admin and am getting an error when trying to access /admin:
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'devise'
gem 'rails_admin'
gem 'pg'
gem 'haml'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer'
gem 'less-rails'
gem 'coffee-script'
gem 'uglifier', '>= 1.0.3'
end
I have custom less styles in app/assets/stylesheets/*
Turned out to be twitter bootstrap & rails admin incompatibility.
Rails admin tried to load the bootstrap.less located in app/assets/stylesheets.
Solution: Rename bootstrap.less to bootstrap-mine.less.