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
Related
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
I have finally installed all the required gems for open source project kandan and ruby on rails however whenever I try and run rake db:create I get thrown this error and i'm not sure how to fix it. If anyone could assist me that would be greatly appreciated :)
kandan dan$ rake db:create
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
rake aborted!
LoadError: cannot load such file -- guard/guard
/Users/dan/kandan/config/application.rb:13:in `<top (required)>'
/Users/dan/kandan/Rakefile:5:in `<top (required)>'
LoadError: cannot load such file -- guard-spork
/Users/dan/kandan/config/application.rb:13:in `<top (required)>'
/Users/dan/kandan/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
For anyone interested in the --trace error:
rake db:create --trace
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
rake aborted!
LoadError: cannot load such file -- guard/guard
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block in require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/guard-spork-1.5.1/lib/guard/spork.rb:2:in `<top (required)>'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:85:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:85:in `rescue in block in require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:68:in `block in require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
/Users/dan/kandan/config/application.rb:13:in `<top (required)>'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/dan/kandan/Rakefile:5:in `<top (required)>'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/dan/.rbenv/versions/2.2.2/bin/rake:33:in `<main>'
LoadError: cannot load such file -- guard-spork
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
/Users/dan/kandan/config/application.rb:13:in `<top (required)>'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/dan/kandan/Rakefile:5:in `<top (required)>'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/dan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/dan/.rbenv/versions/2.2.2/bin/rake:33:in `<main>'
EDIT
Here is what is in /Users/dan/kandan/config/application.rb
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
require "./lib/kandan_config.rb"
module Kandan
class Application < Rails::Application
# Dealing with Heroku-specific eccentricities
config.assets.initialize_on_precompile = false
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
config.active_record.observers = [:activity_observer, :attachment_observer, :channel_observer, :user_observer]
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
config.assets.precompile += ["admin/admin.js", "admin.css"]
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true
config.active_record.mass_assignment_sanitizer = :strict
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
end
end
EDIT Here is what is in my guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
# Capybara features specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch('config/environments/test.rb')
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
watch('test/test_helper.rb') { :test_unit }
watch(%r{features/support/}) { :cucumber }
end
EDIT Here is my gemfile:
source 'https://rubygems.org'
# Core gems
gem 'rails', '~> 3.2.21'
# Database adapters
gem 'pg'
# Uncomment next line when using MySQL database
#gem 'mysql2'
# Auth gems
gem 'devise'
gem 'cancancan', '~> 1.9'
# Server/transport gems
gem 'thin'
gem 'faye'
# Helper gems
gem 'kaminari'
gem 'aws-sdk'
gem 'paperclip'
gem 'remotipart'
gem 'jquery-rails'
gem 'enumerize'
gem 'arel'
gem 'tzinfo'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'bourbon'
gem 'execjs'
gem 'eco'
gem 'uglifier'
gem 'bootstrap-sass', '3.1.1.0'
gem 'sass', '3.2.13'
gem 'gemoji', '~> 1.5.0'
end
group :production do
gem 'kandan-count'
end
group :development do
gem 'kandan-count-dev'
gem 'pry-rails'
gem 'quiet_assets'
gem 'awesome_print'
gem 'better_errors'
gem 'binding_of_caller'
if RUBY_VERSION >= '2.0.0'
gem 'byebug'
else
gem 'debugger'
end
end
group :test do
gem 'faker'
gem 'rspec-rails', '~> 3.1'
gem 'shoulda-matchers'
gem 'factory_girl_rails'
gem 'simplecov', :require => false
gem 'coveralls', :require => false
gem 'poltergeist'
gem 'launchy'
gem 'capybara'
end
group :development, :test do
gem 'sqlite3'
gem 'guard'
gem 'guard-rspec'
gem 'guard-spork'
gem 'database_cleaner'
gem 'jasmine'
end
Based on your Gemfile I can say that you are missing spork in your Gemfile
Edit your Gemfile like this
group :development, :test do
gem 'sqlite3'
gem 'spork', :git => 'git://github.com/sporkrb/spork.git'
gem 'spork-rails'
gem 'guard'
gem 'guard-rspec'
gem 'guard-spork'
gem 'database_cleaner'
gem 'jasmine'
end
Then run bundle install
Initialize it by running in terminal
spork rspec --bootstrap
Re generate your Guardfile by running
guard init rspec
gurad init spork
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 am newbie for ruby on rails i am just reading the http://ruby.railstutorial.org/chapters/static-pages#top as the tutorial saying, i have created the sample_app bundle or project. Now in section 3.2.1 i am testing the app.
first i run the following from the cmd
$ rails generate integration_test static_pages
This created the static_pages_spec.rb in the spec/requests directory.
Now add the following code in spec/requests/static_pages_spec.rb
require 'spec_helper'
describe "Static pages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
expect(page).to have_content('Sample App')
end
end
end
at this stage i add the following code in sample_app/spec/spec_helper.rb file
config.include Capybara::DSL
so my file look like
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
config.include Capybara::DSL
end
i have app/views/static_pages/home.html.erb
<h1>Sample App</h1>
<p>
This is the home page for the
Ruby on Rails Tutorial
sample application.
</p>
and run the command
$ bundle exec rspec spec/requests/static_pages_spec.rb
it was giving the error
c:/wamp/www/rails_projects/sample_app/spec/spec_helper.rb:42:in `block in <top (
required)>': uninitialized constant Capybara (NameError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core.rb:120:in `configure'
from c:/wamp/www/rails_projects/sample_app/spec/spec_helper.rb:15:in `<t
op (required)>'
from c:/wamp/www/rails_projects/sample_app/spec/requests/static_pages_sp
ec.rb:1:in `require'
from c:/wamp/www/rails_projects/sample_app/spec/requests/static_pages_sp
ec.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/command_line.rb:22:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/runner.rb:80:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/runner.rb:17:in `block in autorun'
i have installed the capybara as per direction in git
step 1->gem install capybara
step 2->require 'capybara/rails' in sample_app/spec/spec_helper.rb
but still it was showing the load error of capybara rails
now i run the same command i.e $ bundle exec rspec spec/requests/static_pages_spec.rb
i got the following error
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/act
ive_support/dependencies.rb:228:in `require': cannot load such file -- capybara/
rspec (LoadError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.0/lib/active_support/dependencies.rb:228:in `require'
from c:/wamp/www/rails_projects/sample_app/spec/spec_helper.rb:8:in `<to
p (required)>'
from c:/wamp/www/rails_projects/sample_app/spec/requests/static_pages_sp
ec.rb:1:in `require'
from c:/wamp/www/rails_projects/sample_app/spec/requests/static_pages_sp
ec.rb:1:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `load'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `each'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/command_line.rb:22:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/runner.rb:80:in `run'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1
4.5/lib/rspec/core/runner.rb:17:in `block in autorun'
and my gemfile is
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
group :development, :test do
gem 'rspec-rails', ">= 2.0.0.beta"
end
gem 'rubyzip'
if i remove the config.include Capybara::DSL then i get fail error
Please give me right direction ...thanks in advance
Since you're using Bundler (i.e. you have a Gemfile), you need to make sure Capybara is in there too, otherwise your rails app won't know the gem is installed. Update your Gemfile to include capybara in the development/test environments:
group :development, :test do
gem 'rspec-rails', ">= 2.0.0.beta"
gem 'capybara'
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'}