Rails4: How to serve specific javascript gem files?

I copied the working rails application to another directory and renamed it using rename Gem.

Most of the rail functions work correctly, but I can not service the assets associated with precious stones, in particular js files from bootstrap-slider-rails

I have compared my .rb, Gemfile and application.js applications and they are the same in both applications.

I tried to remove and reinstall the gem

A simple comparison of applications does not solve the problem.

Here are the files that I checked are the same in both applications:

  • Gemfile
  • application.rb
  • application.html.haml
  • application.js

Any suggestions how I should debug this?

Thank!

To show you this problem, compare these 2 images in Rubymine

Working application: Working app

The application does not work: Non-working app

:

application.js enter image description here

application.rb

require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

#if defined?(Bundler)
#  # If you precompile assets before deploying to production, use this line
#  #Bundler.require(*Rails.groups(:assets => %w(development test)))
#  # If you want your assets lazily compiled in production, use this line
#  # Bundler.require(:default, :assets, Rails.env)
#end

# Rails4
Bundler.require(:default, Rails.env)

module Smoothlyhired
  class Application < Rails::Application

    # don't generate RSpec tests for views and helpers
    config.generators do |g|

      g.test_framework :rspec, fixture: true
      g.fixture_replacement :factory_girl, dir: 'spec/factories'


      g.view_specs false
      g.helper_specs false
    end


    config.autoload_paths += %W(#{config.root}/lib)



    config.encoding = "utf-8"

    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password, :password_confirmation]


    config.active_record.schema_format = :sql



    # Enable the asset pipeline
    config.assets.enabled = true

    # Version of your assets, change this if you want to expire all your assets
    config.assets.version = '1.0'

    #Prevent initializing the application and connecting to db on bootup as required by heroku
    #https://devcenter.heroku.com/articles/rails-asset-pipeline
    # Not required on rails4 anymore
    #config.assets.initialize_on_precompile = false

    #config.action_view.javascript_expansions[:defaults] = %w(jquery.min jquery_ujs)
  end
end

Gemfile

source 'https://rubygems.org'
ruby '2.1.0'
gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'font-awesome-sass'
gem 'less-rails'
gem 'therubyracer', :platform=>:ruby
gem 'twitter-bootstrap-rails'
#gem 'jquery_mobile_rails'
gem 'js-routes'
gem 'cancan'
gem 'devise'
gem 'figaro'
gem 'haml-rails'
gem 'pg'
gem 'rolify'
gem 'sendgrid'
gem 'simple_form'
gem 'thin'
gem 'rake'

#To use db for storing cookies instead cookie-store
gem 'activerecord-session_store', github: 'rails/activerecord-session_store'

group :development do
  gem 'better_errors'
  #gem 'binding_of_caller', :platforms=>[:mri_19, :rbx]
  #Commenting out platforms part, because may be that stopping this to be used on the dev machine'
  gem 'binding_of_caller'
  gem 'guard-bundler'
  gem 'guard-rails'
  gem 'guard-rspec'
  gem 'html2haml'
  gem 'quiet_assets'
  gem 'rb-fchange', :require=>false
  gem 'rb-fsevent', :require=>false
  gem 'rb-inotify', :require=>false

  # Required with Rails panel chrome extension. This Gem should come after better_errors gem
  gem 'meta_request'
end
group :development, :test do
  #gem 'factory_girl_rails'
  #gem 'rspec-rails'
  gem 'pry-byebug'
  gem 'pry-stack_explorer'
  gem 'pry-rails'
  gem 'pry-debugger'
  gem 'debugger', '>= 1.6.5'
end

group :test do
  gem 'capybara'
  gem 'database_cleaner'
  gem 'email_spec'
end

group :production do
  gem 'rails_12factor'
end

gem 'high_voltage'

#Linkedin Logins
gem "linkedin"
gem "omniauth"
gem "omniauth-linkedin"

gem "omniauth-facebook"

#postgres use hstore in active record
#gem 'activerecord-postgres-hstore'

gem 'state_machine'
gem "ruby-graphviz"


#payments
#gem 'stripe',:git => 'https://github.com/stripe/stripe-ruby'


#gem 'newrelic_rpm'

gem 'pgbackups-archive'

gem 'pg_search'

gem 'acts-as-taggable-on'

#gem 'activeadmin' , github: 'gregbell/active_admin'
gem "activeadmin", git: "https://github.com/gregbell/active_admin"

#gem 'kaminari'
gem 'bootstrap-slider-rails'

#gem 'twitter_bootstrap_form_for'
#gem 'bootstrap_form'
#gem 'formtastic'
gem 'formtastic-bootstrap'
gem 'rename'
+4
1

gemfile.lock .

. SO rails. , .git git init.

100%, , , .

+1

Source: https://habr.com/ru/post/1540056/


All Articles