简体   繁体   中英

uninitialized constant V1 Only on Cloud9

I just moved my Rails app which uses the versionist gem to www.c9.io. When doing rails s on my local machine I have no problem browsing, however when I try to view it on c9 I get uninitialized constant V1 . I'm not sure where to start as to what to provide you with to help me.

Here is my routes.rb

Rails.application.routes.draw do
    api_version(
        :module => "V1",
        :header => {
        :name => "Accept",
        :value => "application/vnd.ContractTracker; version=1"},
        :default => true) do

      resources :contracts, defaults: {format: :json}

    end
end

The issue ended up being because the path to the controller in question was app/controllers/V1/foo_controller.rb . Once I changed it to app/controllers/v1/foo_controller.rb everything worked fine. Notice the change was V1 to v1 (capital V). I think the fix is how it should have been setup to begin with, I'm not 100% sure why OSX was allowing it to function in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM