Rails console doesn't start - undefiined method cache_control - ruby-on-rails

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.

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 4 & Ruby 1.9 error generating mongoid:config

I'm trying to create a ruby on rails app which can be hosted on Openshift, but i encounter the following error when i try to use the rails g mongoid:config command through terminal. I've tried everything i found on stackoverflow but the error still persists! what am i doing wrong?
here is the error:
/home/themis/.rvm/gems/ruby-2.3.0/gems/activesupport-4.0.3/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/themis/rails4/config/application.rb:6:in `require': cannot load such file -- active_job/railtie (LoadError)
from /home/themis/rails4/config/application.rb:6:in `<top (required)>'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /home/themis/.rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/themis/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/themis/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
and my Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'
gem 'twitter-bootstrap-rails'
gem 'less-rails'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# 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 .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'
# 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'
gem "rspec"
# 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', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# 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]
This is an ActiveSupport bug (thus a Rails bug).
Line 282 at activesupport-4.0.3/lib/active_support/values/time_zone.rb is
def parse(str, now=now)
# ...
end
And line 308 of the same file is
def now
# ...
end
The problem is at the default param now=now, which ruby struggles to understand whether the latter now is a method call or is just a local variable (the param itself).
If you modify the now=now to now=now(), then all is fine.
This bug is fixed in Rails 4.0.6.

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

Gem::LoadError while adding migrations in Rails

When I am running add migrations, i am facing the following issue:
raj#itadmin-HP-Pavilion-17-Notebook-PC:~/Desktop/Projects/invoicemanagement$ rails g migration add_avatars_to_invoice_details avatars:string
Warning: You're using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:33:in `block in setup': You have already activated spring 1.3.3, but your Gemfile requires spring 1.3.2. Using bundle exec may solve this. (Gem::LoadError)
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:19:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler.rb:120:in `setup'
from /usr/lib/ruby/vendor_ruby/bundler/setup.rb:7:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/commands.rb:4:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/spring-1.3.3/lib/spring/server.rb:9:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
and my Gemfile :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
#gem 'therubyracer' , '0.12.1', :platforms => :ruby
# Use sqlite3 as the database for Active Record
gem 'sqlite3', :group => [:development, :test]
group :production do
# gem 'thin'
gem 'pg'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# 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', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'devise'
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
gem 'carrierwave', '~> 0.9'
gem 'bootstrap-sass', '~> 2.3.2'
gem 'prawn'
gem 'prawnto'
gem 'carmen-rails', '~> 1.0.0'
gem 'jquery-datatables-rails', '~> 3.0.0'
gem 'haml', '~> 4.0.5'
gem 'simple_form'
Previously, the migrations are running fine and I also tried using bundle exec before the add migratiion commmeand, but I found no luck.
Please let me know, where I went wrong.
Thanks in advance.
Spring was updated 20 days ago
Try bundle update spring to try fix this problem. This would not only just update your gem, but also update dependencies.
As the message states, you need to update your version of Rubygems, and then run gem pristine --all.
You can update Rubygems by running gem update --system.
Once you've done that, then you can start looking at prefixing your commands with bundle exec.

Resources