I have recently upgraded my gemfile to try and get Rails 3.1 working with Jruby 3.1.
Here is my Gemfile:
source 'http://rubygems.org'
source 'http://gems.engineyard.com'
gem 'rails', '~> 3.1.0.rc4'
gem 'sass-rails'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'
gem 'resque-meta'
gem 'jquery-rails'
gem 'rake'#, '~> 0.8.7'
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'
platforms :jruby do
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
gem 'jdbc-mysql'
gem 'jruby-rack'
gem 'warbler'
#gem 'glassfish', '1.0.3.dev'
end
group :test, :development do
platforms :jruby do
gem 'jdbc-sqlite3', :require => false
gem 'fastercsv'
gem 'ruby-debug'
end
platforms :ruby do
gem 'sqlite3-ruby', :require => 'sqlite3'
end
gem 'mocha'
gem 'factory_girl'
gem 'fakeweb'
gem 'shoulda', :require => 'shoulda'
end
The problem is that when I run rake db:migrate, I get the following error message:
rake aborted! An error has occurred, this and all later migrations
canceled:
undefined method `rows' for nil:NilClass
Has anyone else experienced this.
Upgrading to rails 5 enabled my migrations to build from jruby 1.6.3 anyway:
source 'http://rubygems.org'
source 'http://gems.engineyard.com'
gem 'rails', '~> 3.1.0.rc5'
gem 'sass-rails'
gem 'compass', git: 'https://github.com/chriseppstein/compass.git',branch: 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'
gem 'resque-meta'
gem 'jquery-rails'
gem 'rake'#, '~> 0.8.7'
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'
platforms :jruby do
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
gem 'jdbc-mysql'
gem 'jruby-rack'
gem 'warbler'
#gem 'glassfish', '1.0.3.dev'
end
Related
I am attempting to run a code coverage report using deepcover's simplecov takeover and one test will always fail with a useless stack trace. Even if I skip the failing test with xit the following test will fail with the same error. Stack Trace
Gemfile:
gem 'aws-sdk-s3', '1.4.0' # Amazon WS
gem 'builder'
gem 'bundler'
gem 'fastercsv'
gem 'httpclient'
gem 'jbuilder', '~> 2.10'
gem 'json'
gem 'march_hare', '3.0.0', platform: :jruby # AMQP
gem 'multi_json', '1.9.0'
gem 'newrelic_rpm'
gem 'nokogiri', platform: :jruby
gem 'puma', '~> 4.3' # Known issue with puma 5 on ARM64 / Docker: https://github.com/jruby/jruby/issues/6821
gem 'rack'
gem 'sinatra', '~> 2.1'
gem 'tilt'
gem 'tilt-jbuilder', '>= 0.7', require: 'sinatra/jbuilder'
# gem 'jruby-rack' Is this needed??
gem 'tzinfo', '1.2.3'
gem 'uuidtools'
# Redis
gem 'hiredis'
gem 'redis', '~>3.2'
gem 'redlock'
group :development, :test do
gem 'pry'
gem 'pry-debugger-jruby'
gem 'pry-remote'
gem 'racksh'
gem 'rake'
gem 'rubocop', require: false
gem 'rubocop-rake', require: false
gem 'rubocop-rspec', require: false
gem 'rubocop-sequel', require: false
end
group :test do
# NOTE: latest v2 (v2.0.1 at the time of this writing) does not clean db between examples
gem 'database_cleaner-sequel', '~> 1'
gem 'coverband'
gem 'equivalent-xml', require: false # require after `rspec/matchers` in spec_helper.rb
gem 'fakeredis', require: 'fakeredis/rspec'
gem 'json_spec'
gem 'rack-test', require: 'rack/test'
gem 'rspec'
gem 'rspec-core'
gem 'rspec-expectations', require: 'rspec/expectations'
gem 'rspec_junit_formatter'
gem 'rspec-mocks'
gem 'simplecov', require: false
gem 'simplecov-cobertura'
gem 'vcr'
gem 'webmock'
end
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!
Heroku seems to now default to parallel bundling with -j4 because I see in the push log:
Running: bundle install --without development:test:staging --path
vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
This throws an error which I can replicate locally with
bundle install -j4
The error locally is:
/Users/Emma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/thread.rb:72:in `sleep': No live threads left. Deadlock? from /Users/Emma/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/thread.rb:72:in `block (2 levels) in wait'
The error when I attempt deployment is:
/tmp/build_a49f4fc2-73b3-4101-9b67-f795fa643429/vendor/ruby-2.0.0/lib/ruby/2.0.0/thread.rb:72:in `sleep': No live threads left. Deadlock? (fatal)
How can I force Heroku to stop attempting to bundle gems in parallel?
edit: gemfile
ruby '2.0.0'
source 'http://rubygems.org'
# Rails
gem "rails", "~> 3.2.13"
gem 'rake', '10.1.0'
gem 'rails_12factor', group: :production
# Basic libraries
gem "unicorn", "4.6.2"
gem 'jquery-rails', '2.1.4'
gem 'nokogiri'
gem 'bundler'
gem "activesupport"
gem 'aws-s3'
gem 'aws-sdk' #required in 3.1.3 to get rake to work -- taken out may 13 as conflicts with s3
gem 'hirefireapp'
gem "hirefire-resource"
gem 'newrelic_rpm', "~> 3.6.5.130"
gem 'modernizr-rails'
gem 'gocardless'
# Background processing
gem 'delayed_job_active_record' #required in 3.1.3 to get DJ to work
gem "SystemTimer", :require => "system_timer", :platforms => :ruby_18
gem "rack-timeout"
gem 'delayed_paperclip' , '2.4.5.2' # , :git => 'git://github.com/tommeier/delayed_paperclip', :branch => 'fix_312'
# Views
gem 'haml'
gem 'rdiscount', "~> 1.6.8" #manually included -- it's a dependency of simple tooltip
gem 'simple-tooltip', "~> 0.0.2"
gem 'will_paginate', '~>3.0'
gem 'will_paginate-bootstrap', '0.2.1'
gem 'gritter_notices', '~>0.3.4' #, :git => 'git#github.com:ck3g/gritter_notices.git'
gem "ariane"
gem 'bootstrap-wysihtml5-rails'
gem 'gingerice'
gem 'gvis', '>= 2.0.0'
gem "google_visualr", ">= 2.1"
gem "zendesk_api"
gem "oink"
gem 'rubyzip', '1.0.0'
gem "zip-zip"
gem 's3_swf_upload'
group :assets do
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'less-rails-bootstrap'
gem 'less'
end
gem "twitter-bootstrap-rails" # don't put in assets group for some stupid reason.
gem 'font-awesome-rails'
gem 'rabl'
gem 'gon'
gem 'versioncake', :git => 'git://github.com/bwillis/versioncake.git', :branch => 'master'
gem "oauth-plugin", "~> 0.5.1"
# Authentication and authorisation
gem "cancan", '~> 1.6.7'
gem "devise" #, "~> 1.4.8"
gem 'devise_invitable', '~> 1.0.0'
# Barcodes
gem 'barby' #for generating barcodes
gem 'chunky_png' #for turning barcodes into png
# Forms
gem 'formtastic'
gem 'twitter_bootstrap_form_for'
gem 'client_side_validations', :git => "git://github.com/bcardarella/client_side_validations.git"
gem 'client_side_validations-formtastic'
gem 'cocoon' #adds link_to_add_association functionality in forms, so you can add nested fields using JS. https://github.com/nathanvda/cocoon
gem 'letsrate'
gem 'formtastic-bootstrap', " ~> 2.0.0"
gem 'active_link_to'
# Search
gem "ransack" #:git => "git://github.com/ernie/ransack.git"
gem 'pg_search', "0.7.0"
gem 'ancestry'
# IO
gem "activerecord-import" #used in one off class methods for importing. Provides the .import method.
gem "csv_builder"
gem 'pdfkit'
gem 'wkhtmltopdf'
gem "rmagick"
gem 'paperclip', '~> 2.3'
gem 'paperclip-meta' # extends function of paperclip gem: saves default thumbnail image size info in appropriate table
gem "googlebooks"
gem "amazon-ecs"
gem 'acts_as_xlsx'
gem "prawn", "~> 1.0.0.rc2"
gem 'activemodel-warnings'
gem "roo", "~> 1.11.2"
# Other
gem 'deep_cloneable', '~> 1.5.2'
gem "isbn"
gem 'wicked', '~> 0.5.0' #upgrade problem
gem "strip_attributes", "~> 1.2"
gem "microformats_helper"
gem "sanitize"
gem 'paper_trail', '~> 2'
gem "best_in_place"
gem 'shortener'
gem 'twitter'
gem 'acts-as-taggable-on', "~> 2.3.3" #upgrade problem
gem 'simple_calendar'
gem "yard" # yard server --reload for a server running on 8808
# Rails 3.1 - Asset Pipeline
gem 'json'
gem 'coffee-script'
gem 'sprockets-image_compressor', "~> 0.2.0"
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'yui-compressor'
gem 'compass-rails'
end
# Rails 3.1 - Heroku
gem 'pg', "=0.16.0"
gem 'dalli'
gem 'memcachier'
gem 'seed_dump' # e.g. bundle exec rake db:seed:dump MODELS=ValidationTest,Book
gem "figaro"
group(:development, :test) do
gem 'simplecov', :require => false
gem 'ruby-prof'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git' # run with bundle exec annotate
gem "rails-erd" # for creaating erd diagrams. Run with rake erd
gem 'autotest'
gem 'autotest-rails'
gem 'ZenTest', '4.5.0'
gem 'factory_girl', "~> 3.0.0"
gem 'factory_girl_rails'
gem 'faker', '0.3.1', :require => false
gem 'launchy'
gem 'rspec'
gem 'rspec-core', :require => 'rspec/core'
gem 'rspec-expectations', :require => 'rspec/expectations'
gem 'rspec-mocks', :require => 'rspec/mocks'
gem 'rspec-rails'
gem 'selenium-webdriver', '2.5.0'
gem 'capybara'
gem "fakes3"
end
gem 'lazy_high_charts'
gem 'bullet', group: :development
Some gems have problem installing in parallel, these should be reported to bundler/bundler like this one https://github.com/bundler/bundler/issues/2813
In this Gemfile this is the problem line:
gem 'formtastic-bootstrap', " ~> 2.0.0"
Change to
gem 'formtastic-bootstrap', "2.1.3"
And it works. This is how I found it:
Install bundler latest $ gem install bundler
Then run $ bundle install -j4 this will try to install up to 4 gems in parallel.
When it fails with this error message
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/schneems/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.5.1/lib/bundler/parallel_workers/worker.rb:33:in `pop': No live threads left. Deadlock? (fatal)
Find a Gem not checked out by running
$ bundle list
Could not find gem 'formtastic-bootstrap (~> 2.0.0) ruby' in the gems available on this machine.
Comment out that line in your Gemfile and repeat until your whole Gemfile installs. Once it installs gradually add back in the ones you commented. Likely a later version of a Gem will be able to fix the problem.
I'm working through the upgrade to 3.1, and hit a snag.
I have a model (using Mongoid) that is having it's 'link' method overwritten by Rake, apparently. I'm getting this message:
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Profile#link called at /Users/jeffdeville/Documents/code/ruby/wg/app/models/profile.rb:62:in `block in eql?'
Because the method is resolving, I have no stacktrace or anything. This happens in my rspecs, but the problem does not happen in the console.
Gemfile is below.
Even if you don't know the answer, if you have any suggestions on how I'd even approach the debugging process here, that'd be fantastic.
-Jeff
source 'http://rubygems.org'
gem 'rails', "3.1.0"
gem 'rake'
gem 'mail'
gem 'compass', "~> 0.12.alpha.0"
gem 'jquery-rails'
gem 'haml-rails'
gem "html5-boilerplate"
gem 'mini_fb', :git => 'git://github.com/jeffdeville/mini_fb.git'
gem "json"
gem "bson"
gem "bson_ext"
gem 'sucker'
gem 'crack', :git => 'git://github.com/ericgj/crack.git'
gem 'hoptoad_notifier'
gem 'httparty'
gem 'facebooker2'
gem 'delayed_job'
gem 'delayed_job_mongoid'
gem 'unicorn'
gem 'hirefireapp'
gem 'mogli', :git => 'https://github.com/jeffdeville/mogli.git'
gem 'typhoeus'
gem 'koala'
gem 'foreman'
gem 'heroku'
gem 'rbing'
gem 'rmagick'
gem 'mini_magick'
gem 'aws-sdk'
gem 'mechanize'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
group :development, :test do
gem 'awesome_print'
gem 'pry'
end
group :development do
gem 'rails3-generators'
gem 'coffee-script'
gem 'guard'
gem 'guard-coffeescript'
gem 'guard-livereload'
gem 'guard-rspec'
gem 'guard-spork'
gem 'guard-bundler'
gem 'mailcatcher'
gem 'foreman'
end
group :test do
gem "factory_girl_rails"
gem 'fuubar'
gem 'spork', '~> 0.9.0.rc'
gem 'ruby-debug19'
gem "rspec"
gem "rspec-given"
gem "rspec-rails"
gem 'mocha'
gem "bourne"
gem 'webmock'
gem 'vcr'
gem 'jasmine'
gem 'email_spec'
gem 'timecop'
end
group :mac do
# if RUBY_PLATFORM =~ /darwin/i
gem 'rb-fsevent'
gem 'growl'
# end
end
I was having a similar problem when I did the following:
api_client = API::Client
api_model = 'task' #this is dynamic in reality...
api_client.send(api_model).list
Rake's Global DSL task method was clobbering the send for some reason but the call worked if I called it directly (without using send). In the end I just changed the dynamic call to an veal.
eval "api_client.#{api_model}.list"
It's slower but I'll change it back when they eventually remove the Global DSL from Rake.
HTH, YMMV ;-)
I'm trying to get guard to run guard-sass and guard-jammit on Windows 7 x64, and the behaviour I'm seeing is that it runs, pauses then exits silently, even with --debug active.
We are trying to get our designers (who work on windows, for better or worse), to build things using HAML/SASS and to use automated magnification/asset bundling with Jammit, as opposed to hand-assembling this stuff.
Here is a typical run:
C:\Users\Shibbles\Documents\Inspire>bundle exec guard start --debug
C:\Users\Shibbles\Documents\Inspire>
My Gemfile looks like this:
source 'http://rubygems.org'
gem 'rack', '1.2.1'
gem 'linecache' # 1.8.7
gem 'rails', '3.0.9'
gem 'mysql2', '0.2.7'
gem 'capistrano'
gem 'capistrano-ext'
gem 'awesome_print'
gem "will_paginate", "~> 3.0.pre2"
gem 'haml'
gem 'haml-rails'
gem 'sass'
gem 'factory_girl'
gem 'factory_girl_rails'
gem 'jquery-rails', '>= 1.0.3'
gem 'devise'
gem 'guard'
gem "acts_as_list", "~> 0.1.3"
gem 'jammit'
gem 'win32-open3', :platforms => [:mingw_18, :mingw, :mswin]
gem 'rb-fchange', :platforms => [:mingw_18, :mingw, :mswin]
gem 'rb-notifu', :platforms => [:mingw_18, :mingw, :mswin]
group :development, :test do
gem 'ruby-debug' # 1.8.7
gem "rspec"
gem 'rspec-rails'
gem 'cucumber'
gem 'cucumber-rails'
gem 'capybara'
gem 'database_cleaner'
gem 'spork', '~> 0.9.0.rc'
gem 'rcov'
gem "guard-sass"
gem 'guard-rspec'
gem 'guard-spork'
gem 'guard-bundler'
gem 'guard-delayed'
gem 'growl'
gem 'webrat'
gem 'guard-shell'
end