So I've been having this problem for sometime since I started working with the websocket-rails gem. Apparently it can't autoload my 'broadcast controller' and is preventing me from running rails commands on the command line.
I used to get around this be commenting out the events file and getting things to load. Its honestly a crapshoot, sometimes it works sometimes it doesn't but lately I havn't been getting it to work, I've been trying to debugg this for a while but honestly I'm stuck.
This only happens in development.
Anyone have any ideas?
Here is the error stack:
/Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:513:in `load_missing_constant': Unable to autoload constant BroadcastsController, expected /Users/matt/Documents/sdcc_grp_buy/app/controllers/broadcasts_controller.rb to define it (LoadError)
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:203:in `const_missing'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/inflector/methods.rb:268:in `const_get'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/inflector/methods.rb:268:in `block in constantize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/inflector/methods.rb:266:in `each'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/inflector/methods.rb:266:in `inject'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/inflector/methods.rb:266:in `constantize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:179:in `constantize_controller'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:172:in `validate_string_target'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:153:in `validate_target'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:102:in `store'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:60:in `subscribe'
from /Users/matt/Documents/sdcc_grp_buy/config/events.rb:20:in `block in <top (required)>'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:55:in `instance_eval'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:55:in `evaluate'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/event_map.rb:30:in `initialize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/dispatcher.rb:13:in `new'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/dispatcher.rb:13:in `initialize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/connection_manager.rb:32:in `new'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/websocket_rails/connection_manager.rb:32:in `initialize'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/rails/config/routes.rb:3:in `new'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/rails/config/routes.rb:3:in `block in <top (required)>'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/routing/route_set.rb:391:in `instance_exec'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/routing/route_set.rb:391:in `eval_block'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/routing/route_set.rb:373:in `draw'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/bundler/gems/websocket-rails-3d4bc7cb73e2/lib/rails/config/routes.rb:1:in `<top (required)>'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `load'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/dependencies.rb:287:in `load'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/file_update_checker.rb:77:in `execute'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/routes_reloader.rb:7:in `execute'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/railties-5.0.7/lib/rails/application/finisher.rb:132:in `block (2 levels) in <module:Finisher>'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:396:in `instance_exec'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:396:in `block in make_lambda'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:547:in `block (2 levels) in default_terminator'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:546:in `catch'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:546:in `block in default_terminator'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:170:in `block in halting'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:454:in `block in call'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:454:in `each'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:454:in `call'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:750:in `_run_run_callbacks'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/callbacks.rb:90:in `run_callbacks'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/execution_wrapper.rb:108:in `run!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/reloader.rb:113:in `run!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/reloader.rb:48:in `block (2 levels) in reload!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/reloader.rb:46:in `tap'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/reloader.rb:46:in `block in reload!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/execution_wrapper.rb:85:in `wrap'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.7/lib/active_support/reloader.rb:45:in `reload!'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:164:in `serve'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /Users/matt/Documents/sdcc_grp_buy/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'`
this is what /Users/matt/Documents/sdcc_grp_buy/app/controllers/broadcasts_controller.rb looks like:
class BroadcastsController < WebsocketRails::BaseController
def register_member_to_group
room = message[:room]
member_group_id = message[:member_group_id]
connection = message[:connection]
member_id = message[:member_id]
grp = Group.find(room)
number = grp.member_groups.count
WebsocketRails["group_#{room}"].trigger('member_registered', {room: room, member_group_id: member_group_id, member_id: member_id, connection_id: connection, :num_of_ppl => number})
end
def check_in_member
room = message[:room]
member_id = message[:member_id]
connection = message[:connection]
member = Member.find(member_id)
member.checked_in_date = Date.today
if member.save
WebsocketRails["global"].trigger('check_in_member', {room: room, member_id: member_id, connection_id: connection })
end
end
def check_out_member
room = message[:room]
member_id = message[:member_id]
connection = message[:connection]
member = Member.find(member_id)
member.checked_in_date = Date.today - 25.hours
if member.save
WebsocketRails["global"].trigger('check_out_member', {room: room, member_id: member_id, connection_id: connection })
end
end
def delete_member_from_group
room = message[:room]
member_group_id = message[:member_group_id]
connection = message[:connection]
grp = Group.find(room)
number = grp.member_groups.count
WebsocketRails["group_#{room}"].trigger('unregister_member', {room: room, member_group_id: member_group_id, connection_id: connection, :num_of_ppl => number })
end
def mark_member_as_covered_for_all_groups
member_id = message[:member_id]
end
def group_updated
group_id = message[:room]
count = message[:count]
total = count.split('/')[1]
covered = count.split('/')[0]
if covered == total
complete = true
else
complete = false
end
obj = {
group_id: group_id,
count: count,
complete: complete
}
WebsocketRails["global"].trigger('group_updated', obj)
end
def cover_member_for_group
room = message[:group_id]
member_group_id = message[:member_group_id]
member_id = MemberGroup.find(message[:member_group_id]).member.id
connection = message[:connection]
WebsocketRails["global"].trigger('member_covered', {member_id: member_id, member_group_id: member_group_id, group_id: room, connection_id: connection})
end
def someone_typing
room = message[:room]
connection = message[:connection]
WebsocketRails["group_#{room}"].trigger('someone_typing', {room: room, connection_id: connection})
end
def deactivate_member
member = Member.find(message[:member_id])
member.active = false
member.sponsor_id = nil
connection = message[:connection]
# maybe i need to loop in the JS and not in the controller
if member.save
WebsocketRails["global"].trigger('deactivate_member', { :member_id => member.id,connection_id: connection })
else
puts 'ERROR'
end
end
def activate_member
member = Member.find(message[:member_id])
member.active = true
member.sponsor_id = current_user.id
connection = message[:connection]
# maybe i need to loop in the JS and not in the controller
if member.save
WebsocketRails["global"].trigger('activate_member', { :member_id => member.id,connection_id: connection })
else
puts 'error'
puts member.errors.full_messages.join(',')
end
end
def send_chat_message
type = message[:type]
room = message[:room]
message_id = message[:message]
user_id = current_user.id
connection = message[:connection]
if type == 'group'
WebsocketRails["group_#{room}"].trigger('add_room_message', {room: room, message_id: message_id, user_id: message[:user_id], connection_id: connection})
else
WebsocketRails["global"].trigger('add_global_message', {message_id: message_id, user_id: message[:user_id], connection_id: connection})
end
end
end
and this is what my events.rb file looks like:
WebsocketRails::EventMap.describe do
# You can use this file to map incoming events to controller actions.
# One event can be mapped to any number of controller actions. The
# actions will be executed in the order they were subscribed.
# subscribe :client_connected, 'groups#new_user'
#
# Uncomment and edit the next line to handle the client connected event:
# subscribe :client_connected, :to => Controller, :with_method => :method_name
#
# Here is an example of mapping namespaced events:
# namespace :product do
# subscribe :new, :to => ProductController, :with_method => :new_product
# end
# namespace :chatroom do
# subscribe :create_room, "groups#create_room"
# subscribe :update_members, 'groups#update'
# end
# namespace :members do
subscribe :register_member, "broadcasts#register_member_to_group"
subscribe :unregister, "broadcasts#delete_member_from_group"
subscribe :cover_member, "broadcasts#cover_member_for_group"
subscribe :activate_member, "broadcasts#activate_member"
subscribe :deactivate_member, "broadcasts#deactivate_member"
subscribe :send_chat_message, "broadcasts#send_chat_message"
subscribe :someone_typing, "broadcasts#someone_typing"
subscribe :group_updated, "broadcasts#group_updated"
subscribe :check_in_member, "broadcasts#check_in_member"
subscribe :check_out_member, "broadcasts#check_out_member"
# end
# The above will handle an event triggered on the client like `product.new`.
end
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.0.4'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 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
gem 'devise'
gem 'faker'
gem 'omniauth'
gem 'activerecord-session_store'
# rails generate active_record:session_migration
# gem 'omniauth-facebook', '1.4.0'
gem 'omniauth-facebook'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'``
gem 'dotenv-rails'
gem 'will_paginate', '~> 3.0.6'
gem 'redis', '~> 3.0'
# gem 'redis-namespace'
# Use Unicorn as the app server
# gem 'unicorn'
# gem 'websocket-rails'
gem 'react-rails'
gem 'twilio-ruby', '~> 5.10.5'
# gem 'webpacker'
gem 'webpacker', '~> 3.5'
gem 'websocket-rails', github: 'recurser/websocket-rails', branch: 'bugfix/388-latest-faye-websocket'
# gem 'websocket-rails'
# gem 'websocket-rails', github: 'moaa/websocket-rails', branch: 'threadsocket-rails'
# gem 'aws-sdk', '~> 2'
# gem 'aws-sdk-rails'
# gem 'csv'
group :development, :test do
gem 'sqlite3'
gem 'byebug'
gem 'listen'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :production do
# gem 'websocket-rails' #, github: 'recurser/websocket-rails', branch: 'bugfix/388-latest-faye-websocket'
gem 'pg'
# gem 'mysql2'
gem 'rails_12factor', '0.0.2'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
development.rb:
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = true
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = true
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports.
config.consider_all_requests_local = true
config.action_mailer.perform_deliveries = true
# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = false
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_mailer.smtp_settings = {
:address => "email-smtp.us-west-2.amazonaws.com",
:port => 587,
:user_name => ENV["SES_SMTP_USERNAME"], #Your SMTP user
:password => ENV["SES_SMTP_PASSWORD"], #Your SMTP password
:authentication => :login,
:enable_starttls_auto => true
}
end
Figured it out, the spring servers was hanging, solved by doing this:
spring stop
ref: "rails generate" not working
Related
I am having an issue with when I run rails s. I am working on a legacy application and attempting to upgrade to the latest versions of rails and ruby. Current application is using ruby 2.5.0 and rails 5.2.8. The issue is centered around the following:
/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in require': cannot load such file -- refile/simple_form (LoadError)
When I run bundle install it is successful rendering the following results:
Bundle complete! 43 Gemfile dependencies, 150 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
Run bundle fund for details
When I run bundle fund I get the following:
cancancan (3.3.0) Funding: https://github.com/sponsors/coorasse
I then at cancancan (3.3.0) to my gemfile and run bundle install again which results successfully. I try to run rails s and I continue to get the same error. Any help would be greatly appreciated.
I even tried to set the gem refile to gem 'refile', require: ['refile/rails', 'refile/simple_form']. This does not make a difference.
Current Error after running rails s
user#user-2 project_001 % rails s
=> Booting Puma
=> Rails 5.2.8 application starting in development
=> Run rails server -h for more startup options
Exiting
Traceback (most recent call last):
61: from bin/rails:4:in <main>'
60: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
59: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
58: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands.rb:18:in <top (required)>'
57: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/command.rb:46:in invoke'
56: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/command/base.rb:69:in perform'
55: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch'
54: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command'
53: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run'
52: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:142:in perform'
51: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:142:in tap'
50: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:147:in block in perform'
49: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:51:in start'
48: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:89:in log_to_stdout'
47: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/server.rb:422:in wrapped_app'
46: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/commands/server/server_command.rb:27:in app'
45: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/server.rb:249:in app'
44: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/server.rb:349:in build_app_and_options_from_config'
43: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in parse_file'
42: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in load_file'
41: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in new_from_string'
40: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in eval'
39: from config.ru:3:in block in <main>'
38: from config.ru:3:in require_relative'
37: from /Users/user/Documents/GitHub/Alaska-Project/project_001/config/environment.rb:5:in <top (required)>'
36: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/application.rb:361:in initialize!'
35: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:60:in run_initializers'
34: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:205:in tsort_each'
33: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:226:in tsort_each'
32: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in each_strongly_connected_component'
31: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in call'
30: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in each'
29: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:349:in block in each_strongly_connected_component'
28: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:415:in each_strongly_connected_component_from'
27: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:415:in call'
26: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:50:in tsort_each_child'
25: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:50:in each'
24: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:421:in block in each_strongly_connected_component_from'
23: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:431:in each_strongly_connected_component_from'
22: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from'
21: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component'
20: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:228:in block in tsort_each'
19: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:61:in block in run_initializers'
18: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:32:in run'
17: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/initializable.rb:32:in instance_exec'
16: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/engine.rb:619:in block in <class:Engine>'
15: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/engine.rb:619:in each'
14: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/engine.rb:620:in block (2 levels) in <class:Engine>'
13: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/engine.rb:662:in load_config_initializer'
12: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/notifications.rb:170:in instrument'
11: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.2.8/lib/rails/engine.rb:663:in block in load_config_initializer'
10: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:285:in load'
9: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:257:in load_dependency'
8: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:285:in block in load'
7: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in load'
6: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in load'
5: from /Users/user/Documents/GitHub/Alaska-Project/project_001/config/initializers/simple_form.rb:2:in <top (required)>'
4: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:291:in require'
3: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:257:in load_dependency'
2: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.8/lib/active_support/dependencies.rb:291:in block in require'
1: from /Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in require'
/Users/user/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in require': cannot load such file -- refile/simple_form (LoadError)
Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'next_rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.8'
# Use postgresql as the database for Active Record
# gem 'pg', '0.18.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.12.6'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.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.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '~> 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'#, '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.11.1', require: false
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]
end
# Use debugger
# gem 'debugger', group: [:development, :test]
gem "haml"
gem "omniauth"
gem "omniauth-github"
gem "omniauth-google-oauth2", '~> 0.8.0'
gem "omniauth-openid"
gem "google-api-client"
gem 'cancancan', '~> 3.3'
gem 'bootstrap_form'
gem 'friendly_id'#, '~> 5.0.0'
# gem 'ransack'
# gem 'rdiscount', require: 'tilt/rdiscount'
gem 'ruby_identicon'
gem 'sidekiq'
gem "refile", require: "refile/rails"
# gem "refile-mini_magick"
gem 'simple_form'
gem 'active_link_to'
gem 'chartkick', '~> 3.4', '>= 3.4.2' #gem 'chartkick'
gem 'groupdate'
gem 'faker'
# gem 'skylight'
gem 'bundler', '>= 2.0.0.pre.3' #'~> 2.3'#, '>= 2.0.0.pre3' #,
gem 'bootstrap-sass', '~> 3.4.1'
gem 'sassc-rails', '>= 2.1.0'
gem "font-awesome-rails"
# bring back removed support for respond_with
# gem 'responders', '~> 2.0'
group :production do
gem 'rails_12factor'
# gem 'puma'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
# Listens to file modifications and notifies you about the changes
gem 'listen' #, '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# gem 'guard'
# gem 'guard-minitest'
gem 'better_errors'
# gem 'binding_of_caller'
# gem 'quiet_assets'
# gem 'pry-rails'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara' #, '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
ruby "2.5.0"
simple_form.rb
# Use this setup block to configure all options available in SimpleForm.
require 'refile/simple_form'
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
# complete input. You can remove any component from the
# wrapper, change the order or even add your own to the
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.
# You can make any of these extensions optional by
# renaming `b.use` to `b.optional`.
# Determines whether to use HTML5 (:email, :url, ...)
# and required attributes
b.use :html5
# Calculates placeholders automatically from I18n
# You can also pass a string as f.input placeholder: "Placeholder"
b.use :placeholder
## Optional extensions
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
# to the input. If so, they will retrieve the values from the model
# if any exists. If you want to enable any of those
# extensions by default, you can change `b.optional` to `b.use`.
# Calculates maxlength from length validations for string inputs
b.optional :maxlength
# Calculates pattern from format validations for string inputs
b.optional :pattern
# Calculates min and max from length validations for numeric inputs
b.optional :min_max
# Calculates readonly automatically from readonly attributes
b.optional :readonly
## Inputs
b.use :label_input
b.use :hint, wrap_with: { tag: :span, class: :hint }
b.use :error, wrap_with: { tag: :span, class: :error }
## full_messages_for
# If you want to display the full error message for the attribute, you can
# use the component :full_error, like:
#
# b.use :full_error, wrap_with: { tag: :span, class: :error }
end
# The default wrapper to be used by the FormBuilder.
config.default_wrapper = :default
# Define the way to render check boxes / radio buttons with labels.
# Defaults to :nested for bootstrap config.
# inline: input + label
# nested: label > input
config.boolean_style = :nested
# Default class for buttons
config.button_class = 'btn'
# Method used to tidy up errors. Specify any Rails Array method.
# :first lists the first message for each field.
# Use :to_sentence to list all errors for each field.
# config.error_method = :first
# Default tag used for error notification helper.
config.error_notification_tag = :div
# CSS class to add for error notification helper.
config.error_notification_class = 'error_notification'
# ID to add for error notification helper.
# config.error_notification_id = nil
# Series of attempts to detect a default label method for collection.
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
# Series of attempts to detect a default value method for collection.
# config.collection_value_methods = [ :id, :to_s ]
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
# config.collection_wrapper_tag = nil
# You can define the class to use on all collection wrappers. Defaulting to none.
# config.collection_wrapper_class = nil
# You can wrap each item in a collection of radio/check boxes with a tag,
# defaulting to :span.
# config.item_wrapper_tag = :span
# You can define a class to use in all item wrappers. Defaulting to none.
# config.item_wrapper_class = nil
# How the label text should be generated altogether with the required text.
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
# You can define the class to use on all labels. Default is nil.
# config.label_class = nil
# You can define the default class to be used on forms. Can be overriden
# with `html: { :class }`. Defaulting to none.
# config.default_form_class = nil
# You can define which elements should obtain additional classes
# config.generate_additional_classes_for = [:wrapper, :label, :input]
# Whether attributes are required by default (or not). Default is true.
# config.required_by_default = true
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
# These validations are enabled in SimpleForm's internal config but disabled by default
# in this configuration, which is recommended due to some quirks from different browsers.
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
# change this configuration to true.
config.browser_validations = false
# Collection of methods to detect if a file type was given.
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
# Custom mappings for input types. This should be a hash containing a regexp
# to match as key, and the input type that will be used when the field name
# matches the regexp as value.
# config.input_mappings = { /count/ => :integer }
# Custom wrappers for input types. This should be a hash containing an input
# type as key and the wrapper that will be used for all inputs with specified type.
# config.wrapper_mappings = { string: :prepend }
# Namespaces where SimpleForm should look for custom input classes that
# override default inputs.
# config.custom_inputs_namespaces << "CustomInputs"
# Default priority for time_zone inputs.
# config.time_zone_priority = nil
# Default priority for country inputs.
# config.country_priority = nil
# When false, do not use translations for labels.
# config.translate_labels = true
# Automatically discover new inputs in Rails' autoload path.
# config.inputs_discovery = true
# Cache SimpleForm inputs discovery
# config.cache_discovery = !Rails.env.development?
# Default class for inputs
# config.input_class = nil
# Define the default class of the input wrapper of the boolean input.
config.boolean_label_class = 'checkbox'
# Defines if the default input wrapper class should be included in radio
# collection wrappers.
# config.include_default_input_wrapper_class = true
# Defines which i18n scope will be used in Simple Form.
# config.i18n_scope = 'simple_form'
end
The gem for the missing resource is commented out in your Gemfile:
# gem 'refile', require: 'refile/simple_form'
Also, make sure that the version of refile being installed is at least 0.6.0 (i.e., the version where simple_form support was introduced.) Sometimes conflicts cause bundler to go back to refile 0.3.0.
I had a running app with no problem and just did bundle update and bundle install and now.
I had not bundle updated for the past 4 months I think.
Now when I run $ rails s, I have this error:
".../gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - .../public/assets (Errno::EISDIR)"!
mathieu-To-be-filled-by-O-E-M:~/rails_projects/mathieu_app$ rails s
DEPRECATION WARNING: Support for Rails < 4.1.0 will be dropped. (called from require at /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76)
=> Booting WEBrick
=> Rails 4.0.12 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
DEPRECATION WARNING: Model based mass assignment security has been extracted
out of Rails into a gem. Please use the new recommended protection model for
params or add `protected_attributes` to your Gemfile to use the old one.
To disable this message remove the `whitelist_attributes` option from your
`config/application.rb` file and any `mass_assignment_sanitizer` options
from your `config/environments/*.rb` files.
See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
Exiting
/home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read': Is a directory - /home/mathieu/rails_projects/mathieu_app/public/assets (Errno::EISDIR)
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `initialize'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `new'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `instance_exec'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:30:in `run'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/mathieu/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/initializable.rb:54:in `run_initializers'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/application.rb:215:in `initialize!'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/mathieu/rails_projects/mathieu_app/config/environment.rb:5:in `<top (required)>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `block in require'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/activesupport-4.0.12/lib/active_support/dependencies.rb:229:in `require'
from /home/mathieu/rails_projects/mathieu_app/config.ru:3:in `block in <main>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/mathieu/rails_projects/mathieu_app/config.ru:in `new'
from /home/mathieu/rails_projects/mathieu_app/config.ru:in `<main>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:48:in `app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#global/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands/server.rb:75:in `start'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `tap'
from /home/mathieu/.rvm/gems/ruby-2.0.0-p451#rails3tutorial2ndEd/gems/railties-4.0.12/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
My gem list:
source 'https://rubygems.org'
ruby "2.0.0" # source: https://devcenter.heroku.com/articles/ruby-versions
# Rails 4
gem 'rails', "~> 4.0.3"
# Gems supporting Rails 4 core architecture
gem 'actionpack-action_caching'
gem 'actionpack-page_caching'
gem 'activerecord-session_store'
gem 'activeresource'
gem 'rails-observers'
gem 'turbolinks'
gem 'pg'
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails',
:branch => '3.0.0'
gem 'devise' # authentification
gem 'cancan' # authorization
gem 'rolify', :git => 'git://github.com/EppO/rolify.git' # role management library with resource scoping, added fork due to bug source - stackoverflow.com/questions/13712012/error-pushing-to-heroku-aborting-my-rake-assetsprecompile?rq=1
gem 'figaro' # rails app configuration and keep private stuff...private
gem 'sendgrid' # sendgrid gem
gem 'faker' # to create fake user accounts
gem 'will_paginate' # pagination method
gem 'bootstrap-will_paginate' # configure will_paginate gem to bootstrap pagination style
gem 'font-awesome-rails' # pure css icons
gem 'validates_timeliness' # methods and validations for dates formats
gem 'validate_url' # for URL validations in forms
gem 'dotiw' # overrides the default distance_of_time_in_words and provides a more accurate output
gem 'friendly_id'
# Forms with formtastic
gem 'formtastic'
gem 'formtastic-bootstrap'
# Active admin stuff
gem 'activeadmin', github: 'gregbell/active_admin' # added github because of deployment issue wiht jquery ui http://stackoverflow.com/questions/16844411/rails-active-admin-deployment-couldnt-find-file-jquery-ui
gem 'sass-rails', '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4
gem 'kaminari' #'0.14.1' active admin needs kaminari for pagination; blocked on 0.14.1 because if not get nomethod error per_page kaminari https://github.com/sferik/rails_admin/issues/1868 and https://github.com/amatsuda/kaminari/issues/481
gem 'postgres_ext' # gives a nice set of query methods & Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x
gem 'jquery-rails'
gem 'chosen-rails'
gem 'coffee-rails', '~> 4.0.1' # Master branch not OK with Rails 4, hence we point to branch that comply with Rails 4 by default
gem 'uglifier'
# Geocoding and locations
gem 'geocoder'
gem 'country-select'
group :production do
gem 'rails_12factor'
end
group :development do
gem 'quiet_assets' # mutes assets pipeline log messages
gem 'better_errors' # improve error pages
# retrieve binding of a method's caller in MRI 1.9.2+, only for debugging
gem 'binding_of_caller', platforms: [:mri_19, :rbx]
end
group :development, :test do
gem 'perftools.rb', require: 'perftools' # used to find tasks taking long time (ex when test are too long)
gem 'guard', '>=2.1.0'
gem 'guard-rspec'
gem 'guard-rails-assets'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'pry-rails'
gem 'rspec-collection_matchers'
gem 'i18n-tasks'
end
group :test do
gem 'capybara'
gem 'selenium-webdriver' -ex: flash error messages...
gem 'capybara-webkit' -ex: flash error messages...
gem 'rb-inotify'
gem 'libnotify'
gem 'database_cleaner'
gem 'email_spec'
gem 'cucumber-rails', :require => false #
gem 'launchy'
gem 'shoulda-matchers'
gem 'minitest'
gem 'guard-zeus-client'
If you look in the source code of the sprockets gem (where the error is coming from) you can see that the error is being raised by these lines:
63 begin
64 if File.exist?(#path)
65 data = json_decode(File.read(#path))
66 end
67 rescue MultiJson::DecodeError => e
68 logger.error "#{#path} is invalid: #{e.class} #{e.message}"
69 end
Line 65 is the problem, specifically File.read(#path) - as shown by your error message (sprockets-2.12.3/lib/sprockets/manifest.rb:65:in `read').
Basically, #path is supposed to be a string representing a filename but it's actually pointing to a directory, which is causing File.read to fail. #path is supposed to be pointing to your asset's manifest file (usually created automatically by Sprockets) and I'm not sure why it's getting the incorrect path here - do you have anything that looks relevant to your manifest file in config/application.rb or in your environment config files? What about in app/assets/javascripts/application.js or app/assets/stylesheets/application.css?
Try editing your local copy of sprockets yourself (run "cd `bundle show sprockets`" from your app's directory to find it) and adding puts #path before line 65 above (just make sure you remember to remove it when you're done!) - what does it say?
Hmm... Is it possible that you have Sprocket and structure has been changed, or something like that?
Have you tried to remove that directory ( or just rename it )? This guy removed directory mentioned in error and it worked fine: Trying to install rails- EISDIR error .
There seems to be newer version, have you tried to update? (https://rubygems.org/gems/sprockets-rails)
NOTE: This should be comment but I don't have enough reputation for that...
Removing or commenting out this line of code in development.rb solves the problem:
config.assets.manifest = Rails.root.join("public/assets")
I have my app running successfully on my local machine.
But when I tried to push it to heroku and get it running live on internet, it fails with this error message.
git push heroku mybranch:master
....
undefined method `admin_notes=' for #<ActiveAdmin::Application:0x007fb896f03678>
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/config/initializers/active_admin.rb:55:in `block in <top (required)>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activeadmin-0.6.2/lib/active_admin.rb:66:in `setup'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/config/initializers/active_admin.rb:1:in `<top (required)>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:245:in `load'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-.2.14/lib/active_support/dependencies.rb:245:in `block in load'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:245:in `load'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/engine.rb:592:in `each'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/engine.rb:592:in `block in <class:Engine>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/config/environment.rb:5:in `<top (required)>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environment!'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_fad3ae53-5d67-4131-93b9-c46de602ed36/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
Here is my gem file and active_admin.rb file which I think errors are coming from.
Gemfile
source 'http://rubygems.org'
ruby '2.0.0'
gem 'rails', '3.2.14'
gem 'json'
gem 'thin'
gem 'rails_12factor'
gem 'paymill'
gem 'pg'
gem 'haml'
gem 'jammit', :git => 'https://github.com/documentcloud/jammit.git', :branch => 'master'
gem 'sass-rails'
gem 'uglifier'
gem 'aws-s3'
gem 'aws-sdk'
gem 'friendly_id'
gem 'devise', '~> 2.2.7'
gem 'activeadmin'
gem 'formtastic'
gem 'inherited_resources'
gem 'paperclip', '~> 2.4'
gem 'country_select'
gem 'coffee-script'
group :development, :test do
gem 'escape_utils'
gem 'rails-footnotes'
gem 'rack-webconsole'
gem 'better_errors'
gem 'binding_of_caller'
gem 'pry'
gem 'pry-debugger'
# gem 'taps'
# gem 'steak'
# gem 'spork'
end
group :test do
gem 'factory_girl_rails', '~> 4.1.0'
gem 'rspec-rails', '~> 2.14.0'
gem 'cucumber-rails', '~> 1.4.0', require: false
gem 'database_cleaner', '~> 1.0.1'
# gem 'capybara', '~> 2.1.0'
gem 'simplecov', require: false
end
config/initializers/active_admin.rb
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "IncomeHawk"
# == Default Namespace
#
# Set the default namespace each administration resource
# will be added to.
#
# eg:
# config.default_namespace = :hello_world
#
# This will create resources in the HelloWorld module and
# will namespace routes to /hello_world/*
#
# To set no namespace by default, use:
# config.default_namespace = false
# config.default_namespace = :admin
# == User Authentication
#
# Active Admin will automatically call an authentication
# method in a before filter of all controller actions to
# ensure that there is a currently logged in admin user.
#
# This setting changes the method which Active Admin calls
# within the controller.
config.authentication_method = :http_authenticate
# == Current User
#
# Active Admin will associate actions with the current
# user performing them.
#
# This setting changes the method which Active Admin calls
# to return the currently logged in user.
config.current_user_method = false #:current_user
# == Admin Notes
#
# Admin notes allow you to add notes to any model
#
# Admin notes are enabled by default, but can be disabled
# by uncommenting this line:
#
config.admin_notes = true
# == Controller Filters
#
# You can add before, after and around filters to all of your
# Active Admin resources from here.
#
# config.before_filter :do_something_awesome
# == Register Stylesheets & Javascripts
#
# We recomend using the built in Active Admin layout and loading
# up your own stylesheets / javascripts to customize the look
# and feel.
#
# To load a stylesheet:
# config.register_stylesheet 'my_stylesheet.css'
#
# To load a javascript file:
# config.register_javascript 'my_javascript.js'
end
i am teaching myself Ruby on rails i have got up to the tutorial on running the local web server. i have done everything up to this step and when i run rails server i get this error can someone explain what is going on in this error.
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/d
sl.rb:159:in `group': no block given (yield) (LocalJumpError)
from C:/Users/rto/Desktop/rails_projects/first_app/Gemfile:23:in `eval_g
emfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:30:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:30:in `eval_gemfile'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/dsl.rb:9:in `evaluate'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/definition.rb:19:in `build'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler.rb:148:in `definition'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler.rb:116:in `setup'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/setup.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:116:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:116:in `rescue in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:122:in `require'
from C:/Users/rto/Desktop/rails_projects/first_app/config/boot.rb:6:in `
<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:51:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_
ext/kernel_require.rb:51:in `require'
from script/rails:5:in `<main>'
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3',
# 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 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
group =>assets do
you are missing a colon in gemfile. Should read:
group :assets do
This is bundler complaining about missing blocks. I'd guess that your Gemfile is messed up. That is, you have there something like this
group :development
Whereas you are supposed to provide a block
group :development do
gem 'pry'
# other gems
end
Update:
You have several errors in your Gemfile
gem 'sqlite3',
This shouldn't have a comma
group =>assets do
This should be group :assets do
This error will occur when working with blocks.
When you used the 'yield' statement inside the method and didn't pass block as parameter then it will raise the 'no block given (yield) (LocalJumpError)' error.
def my_method
yield
end
puts my_method
In the above method call we are not passing parameter as a block so it will throw '(LocalJumpError) error'.
Here is the correct way to pass block as a parameter
def my_method
yield
end
puts my_method{puts 'something'}
I have a Rails 3 (Spree) application that I can start in development but not production.
If I run bundle exec unicorn -c config/unicorn.rb -D -E development everything works.
However, bundle exec unicorn -c config/unicorn.rb -D -E production, returns with:
master failed to start, check stderr log for details
Here's the unicorn.stder.log file:
I, [2012-06-04T17:31:54.497851 #10431] INFO -- : listening on addr=/tmp/unicorn-uspatriottactical.socket fd=5
I, [2012-06-04T17:31:54.499222 #10431] INFO -- : Refreshing Gem list
/var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require': can't convert Pathname into String (TypeError)
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:359:in `require_or_load'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `each'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `const_missing'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/bundler/gems/spree_related_products-72cbbfc9ed31/lib/spree_related_products.rb:17:in `block in <class:Engine>'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/rails/uspatriottactical/releases/20120604171150/config/environment.rb:5:in `<top (required)>'
from config.ru:4:in `require'
from config.ru:4:in `block in <main>'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn.rb:44:in `eval'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn.rb:44:in `block in builder'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:696:in `call'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:696:in `build_app!'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:136:in `start'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/unicorn-4.3.1/bin/unicorn:121:in `<top (required)>'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
from /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'
Because this seems like a gem issue, here is my Gemfile:
source 'http://rubygems.org'
gem 'active_shipping', :git => 'git://github.com/Shopify/active_shipping.git'
gem 'carrierwave'
gem 'jquery-rails'
gem 'rails', '~> 3.2.0'
gem 'rmagick'
gem 'spree', :git => 'git://github.com/spree/spree', :branch => '1-1-stable'
gem 'spree_active_shipping', :git => 'git://github.com/spree/spree_active_shipping.git'
gem 'spree_flexi_variants', :git => 'git://github.com/jsqu99/spree_flexi_variants.git'
gem 'spree_reviews', :git => 'git://github.com/spree/spree_reviews.git'
gem 'spree_related_products', :git => 'git://github.com/spree/spree_related_products.git'
gem 'spree_shipworks_api', :path => 'spree_shipworks_api'
gem 'spree_amazon_fps', :path => 'spree_amazon_fps'
# gem 'spree_variant_options', :git => 'git://github.com/citrus/spree_variant_options.git'
gem 'spree_videos', :git => 'git://github.com/iloveitaly/Spree-Videos.git'
gem 'spree_gateway', :git => 'git://github.com/spree/spree_gateway.git'
gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git'
gem 'remit', :git => 'git://github.com/tylerhunt/remit.git'
#gem 'remit', :path => '../remit'
gem 'unicorn'
# temporary
gem 'sqlite3'
gem 'execjs'
gem 'therubyracer'
group :assets do
gem 'coffee-rails', '~> 3.2.0'
gem 'sass-rails', '~> 3.2.0'
gem 'uglifier', '>= 1.2.4'
end
group :console do
gem 'awesome_print', :require => 'ap'
gem 'hirb-unicode'
gem 'wirb'
end
group :development, :test do
gem 'capybara'
gem 'factory_girl_rails'
gem 'faker'
gem 'mysql2'
gem 'pry'
gem 'rspec-rails'
gem 'sunspot_rails', '~> 1.3.1'
gem 'progress_bar', '0.4.0'
gem 'sunspot_solr'
gem "sunspot_with_kaminari", '~> 0.1'
gem 'sqlite3'
gem 'debugger'
end
group :development do
# gem 'heroku'
gem 'pry-rails'
end
group :production do
gem 'capistrano'
gem 'rvm-capistrano'
gem 'mysql2'
gem 'sunspot_rails', '~> 1.3.1'
gem 'progress_bar', '0.4.0'
gem 'sunspot_solr'
gem "sunspot_with_kaminari", '~> 0.1'
end
# Used when running on Heroku
# group :deployment do
# gem 'foreman'
# gem 'pg'
# gem 'thin'
# end
group :test do
gem 'fakeweb'
# Pretty printed test output
gem 'turn', '~> 0.8.3', :require => false
gem 'vcr'
end
Edit: here's my unicorn.rb
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete documentation.
www_dir = "/var/rails/"
app_name = "uspatriottactical"
# Set environment to development unless something else is specified
#env = ENV["RAILS_ENV"] || "production"
# amount of unicorn workers to spin up
worker_processes 2
# Socket to bind to
listen "/tmp/unicorn-#{app_name}.socket"
preload_app true
# restarts workers that hang for 30 seconds
timeout 30
pid "/tmp/unicorn.#{app_name}.pid"
#if env == "production"
user 'app_user', 'app_user' # 'user', 'group'
working_directory "#{www_dir}#{app_name}/current"
shared_path = "#{www_dir}#{app_name}/shared"
stderr_path "#{shared_path}/log/unicorn.stderr.log"
stdout_path "#{shared_path}/log/unicorn.stdout.log"
#end
before_fork do |server, worker|
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
# When sent a USR2, Unicorn will suffix its pidfile with .oldbin and
# immediately start loading up a new version of itself (loaded with a new
# version of our app). When this new Unicorn is completely loaded
# it will begin spawning workers. The first worker spawned will check to
# see if an .oldbin pidfile exists. If so, this means we've just booted up
# a new Unicorn and need to tell the old one that it can now die. To do so
# we send it a QUIT.
#
# This enables 0 downtime deploys.
old_pid = "/var/run/unicorn-#{app_name}.pid.oldbin"
if File.exists?(old_pid) && server.pid != old_pid
begin
Process.kill("QUIT", File.read(old_pid).to_i)
rescue Errno::ENOENT, Errno::ESRCH
# someone else did our job for us
end
end
end
after_fork do |server, worker|
# Unicorn master loads the app then forks off workers - because of the way
# Unix forking works, we need to make sure we aren't using any of the parent's
# sockets, e.g. db connection (since "preload_app true")
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
end
# if preload_app is true, then you may also want to check and
# restart any other shared sockets/descriptors such as Memcached,
# and Redis. TokyoCabinet file handles are safe to reuse
# between any number of forked children (assuming your kernel
# correctly implements pread()/pwrite() system calls)
end
Edit: Per request /var/rails/uspatriottactical/shared/bundle/ruby/1.9.1/gems/polyglot-0.3.3/lib/polyglot.rb
I commented on line 63
require 'pathname'
module Polyglot
#registrations ||= {} # Guard against reloading
#loaded ||= {}
class PolyglotLoadError < LoadError; end
class NestedLoadError < LoadError
def initialize le
#le = le
end
def reraise
raise #le
end
end
def self.register(extension, klass)
extension = [extension] unless Array === extension
extension.each{|e|
#registrations[e] = klass
}
end
def self.find(file, *options, &block)
is_absolute = Pathname.new(file).absolute?
(is_absolute ? [""] : $:).each{|lib|
base = is_absolute ? "" : lib+File::SEPARATOR
# In Windows, repeated SEPARATOR chars have a special meaning, avoid adding them
matches = Dir["#{base}#{file}{,.#{#registrations.keys*',.'}}"]
# Revisit: Should we do more do if more than one candidate found?
$stderr.puts "Polyglot: found more than one candidate for #{file}: #{matches*", "}" if matches.size > 1
if path = matches[0]
return [ path, #registrations[path.gsub(/.*\./,'')]]
end
}
return nil
end
def self.load(*a, &b)
file = a[0].to_str
return if #loaded[file] # Check for $: changes or file time changes and reload?
begin
source_file, loader = Polyglot.find(file, *a[1..-1], &b)
if (loader)
begin
loader.load(source_file)
#loaded[file] = true
rescue LoadError => e
raise Polyglot::NestedLoadError.new(e)
end
else
raise PolyglotLoadError.new("Failed to load #{file} using extensions #{(#registrations.keys+["rb"]).sort*", "}")
end
end
end
end
module Kernel
alias polyglot_original_require require
def require(*a, &b)
polyglot_original_require(*a, &b) # <- line 63
rescue LoadError => load_error
begin
Polyglot.load(*a, &b)
rescue Polyglot::NestedLoadError => e
e.reraise
rescue LoadError
# Raise the original exception, possibly a MissingSourceFile with a path
raise load_error
end
end
end
Upgrading to ruby 1.9.3 corrects this issue.
See github.com/cjheath/polyglot/issues/2 for details.
Apparently there is an issue with ruby 1.9.1 and 1.9.2 that RVM installs.