Open i108 opened 8 years ago
@i108 did you solve it somehow?
@i108 @trekdemo require 'rails/all'
in spec_helper.rb
solved this for us on Rails 5
may close this? cc/ @ashoda
@nblumoe That seems like overkill, a require 'rails'
got me past this initial error (though I'm working through other ones)
Strangely I resolved such issue with my app by adding json
to Gemfile
. See https://github.com/bundler/bundler/issues/5492#issuecomment-322827729
Same error here since I upgraded to Rails 5.1
/.rvm/gems/ruby-2.4.2/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:134:in
block in perform': undefined method application' for Thor::Rails:Module (NoMethodError)
Still looking for a fix. I have the error with at least thor 0.19.1 and 0.19.4.
@akostadinov thanks, adding json to Gemfile works for me on clean Fedora 27 install. Installing json with gem install doesnt seem to work without Gemfile edit.
@DamienMetzger Did you ever find a solution to the error you posted here? I'm getting the same while upgrading to rails 5.1.4 and I'm stumped
I have the same problem, and adding json to Gemfile did not work. Can someone help me ?
rails generate model user
/home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:118:in ensure in preload': undefined method
application' for Rails:Module (NoMethodError)
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:122:in preload' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:153:in
serve'
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:141:in block in run' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:135:in
loop'
from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application.rb:135:in run' from /home/thomasleoty/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in
<top (required)>'
from /usr/share/rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /usr/share/rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in
require'
from -e:1:in `
GEMFILE : source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
gem 'rails', '~> 5.2.1'
gem 'sqlite3'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'json'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end
group :development do
gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2'
gem "spring", group: :development
gem 'spring-watcher-listen', '~> 2.0.0' end
group :test do
gem 'capybara', '>= 2.15' gem 'selenium-webdriver'
gem 'chromedriver-helper' end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
anyone run into this
running Rails 4.2.4 on Ruby 2.2.3