westfieldlabs / apivore

Tests your rails API against its Swagger description of end-points, models, and query parameters.
Apache License 2.0
213 stars 66 forks source link

undefined method `application' for Rails:Module #75

Open i108 opened 8 years ago

i108 commented 8 years ago

anyone run into this

undefined method `application' for Rails:Module
# xxxx/gems/ruby-2.2.3/gems/apivore-1.4.5/lib/apivore/swagger_checker.rb:75:in `fetch_swagger!'

running Rails 4.2.4 on Ruby 2.2.3

trekdemo commented 8 years ago

@i108 did you solve it somehow?

nblumoe commented 8 years ago

@i108 @trekdemo require 'rails/all' in spec_helper.rb solved this for us on Rails 5

lucasrenan commented 7 years ago

may close this? cc/ @ashoda

aegixx commented 7 years ago

@nblumoe That seems like overkill, a require 'rails' got me past this initial error (though I'm working through other ones)

akostadinov commented 7 years ago

Strangely I resolved such issue with my app by adding json to Gemfile. See https://github.com/bundler/bundler/issues/5492#issuecomment-322827729

DamienMetzger commented 6 years ago

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:inblock 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.

ar7max commented 6 years ago

@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.

bzswords commented 6 years ago

@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

ghfr commented 5 years ago

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 methodapplication' 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:inserve' 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:inloop' 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:inrequire' from -e:1:in `

'

GEMFILE : source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.1'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.2.1'

Use sqlite3 as the database for Active Record

gem 'sqlite3'

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 'mini_racer', platforms: :ruby

gem 'json'

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

group :development, :test do

Call 'byebug' anywhere in the code to stop execution and get a debugger console

gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end

group :development do

Access an interactive console on exception pages or by calling '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", group: :development

gem 'spring-watcher-listen', '~> 2.0.0' end

group :test do

Adds support for Capybara system testing and selenium driver

gem 'capybara', '>= 2.15' gem 'selenium-webdriver'

Easy installation and use of chromedriver to run system tests with Chrome

gem 'chromedriver-helper' end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]