block error learning ruby on rails - ruby-on-rails

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'}

Related

Incompatible library version with Ruby 2.5.8 and Rails 5.2.4

I have an installed Ruby on Rails app running in production and on my local dev machine. I recently spun up a new beta server in order to upgrade my OS. However, when I completed the setup of the server and started it up, I got the following error from Passenger.
incompatible library version - /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack/msgpack.so (LoadError)
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:11:in `require'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:11:in `rescue in <top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack.rb:8:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `require'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `block in <top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/explicit_require.rb:44:in `rescue in with_gems'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/explicit_require.rb:40:in `with_gems'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/store.rb:4:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache.rb:74:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache.rb:74:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap.rb:5:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap.rb:5:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/setup.rb:2:in `require_relative'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/bootsnap-1.4.8/lib/bootsnap/setup.rb:2:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/boot.rb:4:in `require'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/boot.rb:4:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/application.rb:1:in `require_relative'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/application.rb:1:in `<top (required)>'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/environment.rb:2:in `require_relative'
/home/deploy/EstimatorHiQ/beta/releases/20201220204711/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
/home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:382:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
I have tried
uninstalling msgpack gem and reinstalling
running gem pristine --all
bundle install --redownload
and nothing makes any difference whatsoever. I am about to lose my mind. As far as I have been able to see, the setup on my dev, beta, and production machines are identical as is the code being run. However, since I only get an error on the beta server, that cannot possibly be true.
Does anyone see something that I am missing? Any help at all, even simply pointing me in a direction would be most welcome. I simply don't have any more threads to pull on and am at the end of my rope. Help!
As requested in the first comment, here are the results of running ldd at the command line. I am running Linux.
~$ ldd /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/msgpack-1.3.3/lib/msgpack/msgpack.so
linux-vdso.so.1 (0x00007ffeaa5b8000)
libruby.so.2.5 => /home/deploy/.rbenv/versions/2.5.8/lib/libruby.so.2.5 (0x00007fd84b412000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd84b021000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd84ae02000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd84abfe000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fd84a9c6000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd84a628000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd84bb57000)
Here are the location and contents of my gems directory:
deploy#estimator-cloud-beta:~$ cd /home/deploy/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems/
deploy#estimator-cloud-beta:~/EstimatorHiQ/beta/shared/bundle/ruby/2.5.0/gems$ ls
actioncable-5.2.4 ffi-1.13.1 rails-dom-testing-2.0.3
actionmailer-5.2.4 globalid-0.4.2 rails-html-sanitizer-1.3.0
actionpack-5.2.4 htmlentities-4.3.4 railties-5.2.4
actionview-5.2.4 i18n-1.8.5 rake-13.0.1
activejob-5.2.4 jbuilder-2.10.1 rb-fsevent-0.10.4
activemodel-5.2.4 jquery-rails-4.4.0 rb-inotify-0.10.1
activerecord-5.2.4 jquery-turbolinks-2.1.0 rdoc-4.3.0
activestorage-5.2.4 json-1.8.6 record_tag_helper-1.0.1
activesupport-5.2.4 less-2.6.0 rubyzip-1.1.7
acts_as_xlsx-1.0.6 less-rails-5.0.0 sass-3.7.4
arel-9.0.0 loofah-2.7.0 sass-listen-4.0.0
axlsx-2.1.0.pre mail-2.7.1 sass-rails-5.1.0
axlsx_rails-0.5.2 marcel-0.3.3 sdoc-0.4.2
axlsx_styler-0.2.0 method_source-1.0.0 sprockets-3.7.2
barby-0.6.8 mimemagic-0.3.5 sprockets-rails-3.2.2
bcrypt-3.1.16 mini_mime-1.0.2 thor-1.0.1
bootsnap-1.4.8 mini_portile2-2.4.0 thread_safe-0.3.6
builder-3.2.4 minitest-5.14.2 tilt-2.0.10
chunky_png-1.3.12 momentjs-rails-2.5.1 turbolinks-5.2.1
coffee-rails-5.0.0 msgpack-1.3.3 turbolinks-source-5.2.0
coffee-script-2.4.1 mysql2-0.5.3 twitter-bootstrap-rails-3.2.2
coffee-script-source-1.12.2 nio4r-2.5.4 tzinfo-1.2.7
commonjs-0.2.7 nokogiri-1.10.10 uglifier-4.2.0
concurrent-ruby-1.1.7 pagy-3.8.3 websocket-driver-0.7.3
crass-1.0.6 rack-2.2.3 websocket-extensions-0.1.5
erubi-1.9.0 rack-test-1.1.0
execjs-2.7.0 rails-5.2.4
I spent a few more hours trying to figure out the problem. I used 'gem remove msgpack' to remove the gem. Then I used 'bundle install' and it showed as installed. Then I tried to remove the gem again, and it said it wasn't in the gem file.
After each change above, I also restarted the nginx server to test. The outcome was the same.
I am so frustrated. I am ready to start over, but if there is an error in my configuration, I will got through the whole process and end up with the same problem.
How do I make sure that I completely remove the msgpack gem and then reinstall it from scratch? I'm also open to any other helpful ideas anyone may have on how to proceed. Thanks!
As requested, here are the contents my Gemfile:
source 'https://rubygems.org'
# Export data to spreadsheets
gem 'axlsx', '2.1.0.pre'
gem 'axlsx_rails'
gem 'acts_as_xlsx'
gem 'axlsx_styler'
# Barby barcode generator
gem 'barby', '~> 0.6.6'
gem 'bootsnap'
gem 'msgpack'
# gem 'bigdecimal', '>=1.4', '<2.0.0'
gem 'chunky_png'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.2.4'
gem 'railties', '5.2.4'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# gem 'rails_12factor', group: :production
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '>= 4.2.0'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks', '~> 2.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# gem 'bootstrap-sass', '~> 3.3.5.1'
gem 'momentjs-rails', '~> 2.5.0'
# gem 'bootstrap3-datetimepicker-rails', '~> 3.0.0.1'
gem 'twitter-bootstrap-rails', '~> 3.2'
# for paginating ActiveRecord search results
gem 'pagy'
# to continue to use div_for which has been deprecated
gem 'record_tag_helper', '~> 1.0'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
# Formtastic - making form creation easier
gem 'formtastic', '~>3.1.2'
# Responders for AJAX
gem 'responders', '~> 2.0'
gem 'capistrano', '~> 3.4.0'
gem 'capistrano-bundler', '~> 1.1', '>= 1.1.4'
gem 'capistrano-rails', '~> 1.1', '>= 1.1.5'
#gem 'capistrano-rbenv', github: "capistrano/rbenv"
gem 'capistrano-rbenv', '~> 2.0', '>= 2.0.3'
gem 'rspec-rails', '~> 3.0'
# gem 'capybara'
gem 'pry-rails'
end
My environments.rb:
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!

Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'

I'm struggling for many hours now using activerecord-jdbcmssql-adapter with Rails 5.1 (or 5.2). I've installed ant to be able to compile the gem during the bundling. The bundle process runs fine but when I want to start rails I'm just getting
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmssql-adapter'.
Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'
I've googled a lot but didn't find a solution or a hint what causes this error. Here is some more information:
Java version: Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Ruby: jruby-9.1.17.0
OS: Win10
Part of the Gemfile
ruby '2.3.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.6'
gem 'activerecord-jdbc-adapter', github: "jruby/activerecord-jdbc-adapter", :branch => "51-stable"
gem 'activerecord-jdbcmssql-adapter',github: "jruby/activerecord-jdbc-adapter",:branch => "51-stable"
gem 'activerecord-oracle_enhanced-adapter','~> 1.8.0'
The Backtrace
Q:\Ruby\jruby-9.1.17.0\bin\jruby.exe -S rails s
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcmssql-adapter'.
Gem Load Error is: undefined method `type_cast_from_database' for class `ArJdbc::MSSQL::UUIDType'
Backtrace for gem load error is:
org/jruby/RubyModule.java:2841:in `alias_method'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:319:in `<class:UUIDType>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:316:in `<module:MSSQL>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:2:in `<module:ArJdbc>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/types.rb:1:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:1:in `<module:(root)>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:37:in `<module:MSSQL>'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:30:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql/adapter.rb:29:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
o:/bundler/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql.rb:1:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/lib/arjdbc/mssql.rb:2:in `block in (root)'
org/jruby/RubyArray.java:1735:in `each'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/activerecord-jdbcmssql-adapter/lib/activerecord-jdbcmssql-adapter.rb:1:in `block in (root)'
org/jruby/RubyArray.java:1735:in `each'
o:/bundler/bundler/gems/activerecord-jdbc-adapter-4eebab4df17d/activerecord-jdbcmssql-adapter/lib/activerecord-jdbcmssql-adapter.rb:2:in `(root)'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:1:in `(root)'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:81:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:76:in `block in require'
org/jruby/RubyKernel.java:1765:in `tap'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:65:in `require'
Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler.rb:114:in `require'
O:/git/xxxx/config/application.rb:7:in `(root)'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:1:in `(root)'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `perform'
o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform'
o:/bundler/gems/thor-0.20.0/lib/thor/command.rb:27:in `<main>'
org/jruby/RubyKernel.java:956:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
block in require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:84
each at org/jruby/RubyArray.java:1735
block in require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:76
each at org/jruby/RubyArray.java:1735
require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler/runtime.rb:65
require at Q:/Ruby/jruby-9.1.17.0/lib/ruby/gems/shared/gems/bundler-1.16.2/lib/bundler.rb:114
<main> at O:/git/xxx/config/application.rb:7
require at org/jruby/RubyKernel.java:956
block in (root) at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:1
tap at org/jruby/RubyKernel.java:1765
perform at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133
perform at o:/bundler/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130
run at o:/bundler/gems/thor-0.20.0/lib/thor/command.rb:27
invoke_command at o:/bundler/gems/thor-0.20.0/lib/thor/invocation.rb:126
dispatch at o:/bundler/gems/thor-0.20.0/lib/thor.rb:387
perform at o:/bundler/gems/railties-5.1.6/lib/rails/command/base.rb:63
<main> at o:/bundler/gems/railties-5.1.6/lib/rails/command.rb:44
require at org/jruby/R
I tried it with older rails version: 4.2.10. Here is my gemfile below.
After that i can run rails s, rails c and connect to my mssql db.
Note this is just the from the rails new app_name command.
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.2.10'
# Use jdbcsqlite3 as the database for Active Record
gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3', '>= 1.3.20'
gem 'activerecord-jdbcmssql-adapter', '~> 1.3', '>= 1.3.20'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyrhino'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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', '~> 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.1.0', require: false
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Here is my config/database.yml:
default: &default
adapter: jdbcmssql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
mode: dblib
host: <%= ENV.fetch("MSSQL_HOST") { 'localhost' } %>
port: <%= ENV.fetch("MSSQL_PORT") { 1433 } %>
username: SA
password: '!P4ssw0rd'
development:
<<: *default
database: development_mssql
Here is output when i run rbenv local:
$ rbenv local
jruby-9.2.0.0
AR-JDBC does not support MS-SQL for AR >= 5.0
there simply wasn't enough resources to implement the SQLServer adapter.
however, the sqlserver adapter seems to have JRuby support these days.
there's some minor details where it behaves differently, but not much to worry about (except that it might be noticeably slower due pure .rb parts).

Rails console doesn't start - undefiined method cache_control

So I'm trying to run rails console but I get the following error:
/var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_dispatch/http/response.rb:89:in `<class:Response>': undefined method `cache_control' for class `ActionDispatch::Response' (NameError)
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_dispatch/http/response.rb:35:in `<module:ActionDispatch>'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_dispatch/http/response.rb:6:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller/metal/live.rb:1:in `require'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller/metal/live.rb:1:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller.rb:4:in `require'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller.rb:4:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller/railtie.rb:2:in `require'
from /var/lib/gems/2.3.0/gems/actionpack-5.1.3/lib/action_controller/railtie.rb:2:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/activerecord-5.1.3/lib/active_record/railtie.rb:9:in `require'
from /var/lib/gems/2.3.0/gems/activerecord-5.1.3/lib/active_record/railtie.rb:9:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/railties-5.1.3/lib/rails/all.rb:14:in `require'
from /var/lib/gems/2.3.0/gems/railties-5.1.3/lib/rails/all.rb:14:in `block in <top (required)>'
from /var/lib/gems/2.3.0/gems/railties-5.1.3/lib/rails/all.rb:12:in `each'
from /var/lib/gems/2.3.0/gems/railties-5.1.3/lib/rails/all.rb:12:in `<top (required)>'
from /home/isaac/buzzrails/config/application.rb:3:in `require'
from /home/isaac/buzzrails/config/application.rb:3:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /var/lib/gems/2.3.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I've tried restarting spring but it didn't work. Any ideas?
Edit:
This is my config/application.rb:
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Buzzbomb
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
# 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.
end
end
and this is my 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.1.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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
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]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
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'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'nokogiri'
gem 'typhoeus'
gem 'json'
gem 'tux'
I'm not sure what I'm doing wrong - appreciate any suggestions, running on a nginx server. It works locally but I get the error when I do "rails console" on the server.
I just ran into the same error while upgrading from Rails 4 to Rails 5 and it turned out to be a bad merge in my Gemfile.lock.
I re-bundled (bundle update rails) and now it's working again.
Generate project with rails new my_api --api
gem 'actionpack-action_caching'
caches_action :index
And got error:
app/controllers/api/v1/traces_controller.rb:10:inclass:TracesController': undefined method caches_action' for Api::V1::TracesController:Class (NoMethodError)
UPD Ok, in case you application controller inherited from ActionController::API, just:
include ActionController::Caching in application_controller.

There was an error while trying to load the gem 'ahoy_matey'

I'm not actually a ruby dev, I'm just trying to get development environment setup from a project and I'm having a world of trouble getting the gems in order so I can load up the server. I do mostly front-end work. Anyways, my error is:
There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
I've been searching google for last two days and can't come across anyone experiencing this issue with "ahoy_matey" gem. I get this error when trying to launch the server or rake migrations.
Ruby 1.9.3
Rails 3.2.13
mysql2 0.3.17
Any help is appreciated.
Full trace:
Bundler::GemRequireError: There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
Backtrace for gem load error is:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:43:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:39:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:77:in `block in run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/bin/rake:33:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
Bundler Error Backtrace:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:90:in `rescue in block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
(See full trace by running task with --trace)
source 'http://rubygems.org'
gem 'rails', '3.2.13'
gem 'mysql2'#, '~> 0.3.11'
gem 'sass-rails', '~> 3.2.3' # Because SCSS is compiled for embedded quoters
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'execjs', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails', '~> 3.0.4'
gem 'jquery-ui-rails', '~> 4.0.5'
gem 'jquery_datepicker'
group :production do
gem 'pry', require:false
end
group :development, :test do
gem 'capybara', :require => false
gem 'database_cleaner', :require => false # for use with capybara tests
gem 'factory_girl', '~> 4.1' # for generating test models
gem 'factory_girl_rails', require:false
gem 'forgery' # for generating test data
gem 'pry'
gem 'pry_debug'
gem 'pry-nav'
gem 'spork-rails', platform: [:mswin, :mingw] # Fast rpsec testing on Windows
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :development do
gem 'thin' # Sane development server
gem 'bullet' # for identifying areas to speed up database queries
gem 'meta_request' # for chrome rails-panel
gem 'rack-mini-profiler', require:false
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :test do
gem 'launchy', :require => false
gem 'rspec-rails'
gem "selenium-webdriver", "~> 2.40.0" # for AJAX testing
gem 'shoulda', :require => false
gem 'simplecov', :require => false # Test coverage
gem 'timecop'
gem 'vcr', '~> 2.9.3'#'~> 2.5.0'
gem "webmock", '~> 1.10.2'
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :dev, :release, :development do
gem 'better_errors'
gem 'binding_of_caller' # supports better errors by providing IDE in browser when error occurs
end
gem 'activeuuid', '>= 0.5.0'
gem 'ahoy_matey', '1.1.0' #needs this exact version in order to output UUIDs consistently. the next version after does not.
gem 'american_date' # by default, dates are parsed/formatted with American style
gem 'angularjs-rails', '~> 1.0.7'
gem 'attr_encrypted', '~> 1.2' # encrypt activerecord attributes in db
gem 'authlogic', '~> 3.2' # user login
gem 'aws-sdk'
gem 'capistrano', require: false# deployment of application
gem 'capistrano-ext', require: false
gem 'carrierwave' # file upload solution
gem 'daemons' # used for running delayed_job jobs
gem 'encryptor', '~> 1.1' # handle encryption of ActiveRecord fields
gem 'exception_notification', '~> 4.0.0'
gem 'faraday' # REST client for interfacing with external APIs
gem 'faraday_middleware'
gem 'fog', '~> 1.22' # for Amazon Web Services cloud storage
gem 'formatador', '~> 0.2' # This shouldn't need to be here. It is/was a dependency for fog-core, but it wasn't getting bundled (for some reason), so raking assets:precompile consistently failed. 2014-09-17.
gem 'haml', '~> 4.0.3'
gem 'holidays', '~> 2.1.0'
gem 'httpi', '~> 2.2.7'
gem 'json', '~> 1.8.1' # Specified so as to 'safely' conduct an update for the sake of stripe gem (2014-05-21)
gem 'liquid', '~> 2.5.0' # rendering templates, such as Marketing::Email::Template
gem 'mini_magick' # photo resizing
gem 'momentjs-rails'
gem 'multi_xml'
gem 'paperclip', '~> 3.5.0' # handle file attachments to activerecord
gem "paypal-recurring"
gem 'nested_form'
gem 'rails3-jquery-autocomplete'# supports autocomplete fields
gem 'redis' # for publishing
gem 'remotipart', '~> 1.0' # enables multipart form submissions over ajax
gem 'ruby-saml', '~> 1.0.0'
gem 'rvm-capistrano', require: false # for deploying to servers where multiple rubies are available
gem 'safe_attributes' # takes care of attribute name collisions w/ ActiveRecord (we use 'delay')
gem 'savon', '~> 2.7'
gem "select2-rails" # makes an autocomplete select box, compatible with x-editable
gem 'sidekiq', '~> 2.17.0' # handles background/delayed jobs
gem 'spreadsheet', require: false
gem "stripe", '~> 1.11.0'
gem 'tinymce-rails', '>= 4.0.8' # version 4.0.8 includes important bug fixes
gem 'transaction_retry' # Catch mysql deadlock and try again
gem 'tzip', '~> 0.0.4' # Find timezone by zip code
gem 'whenever', require: false # handles scheduled tasks
gem 'wicked_pdf' # creates pdfs from html (is a wrapper for wkhtmltopdf)
gem 'will_paginate', '~> 3.0' # paginates index pages for activerecord
gem 'wkhtmltopdf-binary' # the backend linux tool that creates pdfs from html using QT Webkit rendering engine
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
Looks like you might be requiring your bundle before requiring rails. If you have these two lines in your application.rb file, they need to be in this order:
require 'rails/all'
Bundler.require(:default, Rails.env)
So I see you're running just rails s. I know this question is old but maybe this might help someone else. So the command you want to be running is:
bundle exec rails s
bundle exec executes a command in the context of the bundle.
This command executes the command, making all gems specified in the Gemfile available to require in Rails.
Essentially, if you would normally have run something like rspec spec/my_spec.rb, and you want to use the gems specified in the Gemfile and installed via bundle install, you should run bundle exec rspec spec/my_spec.rb.
Note that bundle exec does not require that an executable is available on your shell's $PATH.
Source

Error when loading Rails server (Rails 4)

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")

Resources