ruby-on-rails-4.1

Asset filtered out and will not be served: add `config.assets.precompile

…衆ロ難τιáo~ 提交于 2019-11-28 06:10:53
I just migrated my Application to rails 4.1.0 from 4.1.rc2 . Started getting these errors for my JS files ActionView::Template::Error: Asset filtered out and will not be served: add `config.assets.precompile += %w( my_js )` to `config/application.rb` and restart your server Responding to urging from Heroku, the Rails maintainers have merged sanity checks from the sprockets_better_errors gem into Rails 4.1. See https://github.com/rails/sprockets-rails/pull/84 The intent is to reveal asset pipeline errors that you would see in production when you run the app in development mode. You probably are

Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4

删除回忆录丶 提交于 2019-11-27 17:33:30
I am doing assets pre-compile, and running the application in production mode. After compilation when I load the my index page I got followings warnings in the chrome console: Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.ttf?v=2.0.0 prospects:1 OTS parsing error: invalid version tag Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.woff?v=2.0.0 prospects:1 OTS parsing error: invalid version tag The issue is its not loading icons instead of that its showing squares . we used the custom fonts and the code is: @font-face { font-family: 'icomoon'; src

Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded

混江龙づ霸主 提交于 2019-11-27 17:05:29
In my gemfile I have: gem 'mysql2' My database.yml is as follows: default: &default adapter: mysql2 database: <%= ENV['db_name'] %> username: <%= ENV['db_user'] %> password: <%= ENV['db_pass'] %> host: <%= ENV['db_host'] %> pool: 32 socket: <%= ENV['socket'] %> development: <<: *default production: <<: *default I've run both bundle update and bundle install and my Gemfile.lock shows mysql2. However when I run rake db:migrate I get this on both my computer and on the staging server: myproject.com(master)$ rake db:migrate WARNING: Use strings for Figaro configuration. 10000012508 was converted

Rails 4 - undefined method `call' when doing a simple query

て烟熏妆下的殇ゞ 提交于 2019-11-27 13:51:03
问题 I'm new to Rails but this seems pretty straightforward. I have a model called Game generated like this: rails generate model Game name:string year:integer manufacturer:string notes:string is_active:boolean I've loaded the table with some data, and I am trying to fetch all of the rows where is_active is true . I'd like my model to be something like: class Game < ActiveRecord::Base scope :active, where(:is_active => 1) end My problem is whenever I try to bind to the Game.active query I get an

Set header in RSpec 3 request

左心房为你撑大大i 提交于 2019-11-27 10:22:19
问题 I'm trying to set the header for some RSpec requests that require authentication. The header is ACCESS_TOKEN . No matter how I attempt to set the header, it never gets set. I know the app works because I can manually test it, I just cant get rspec tests to work. See the full source code & tests for this problem here: https://github.com/lightswitch05/rspec-set-header-example Since authentication is used in most of my request specs, I've created support helper module to retrieve an access token

Asset filtered out and will not be served: add `config.assets.precompile

﹥>﹥吖頭↗ 提交于 2019-11-27 01:19:17
问题 I just migrated my Application to rails 4.1.0 from 4.1.rc2 . Started getting these errors for my JS files ActionView::Template::Error: Asset filtered out and will not be served: add `config.assets.precompile += %w( my_js )` to `config/application.rb` and restart your server 回答1: Responding to urging from Heroku, the Rails maintainers have merged sanity checks from the sprockets_better_errors gem into Rails 4.1. See https://github.com/rails/sprockets-rails/pull/84 The intent is to reveal asset

Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4

此生再无相见时 提交于 2019-11-26 22:33:54
问题 I am doing assets pre-compile, and running the application in production mode. After compilation when I load the my index page I got followings warnings in the chrome console: Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.ttf?v=2.0.0 prospects:1 OTS parsing error: invalid version tag Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.woff?v=2.0.0 prospects:1 OTS parsing error: invalid version tag The issue is its not loading icons instead of that

TZInfo::DataSourceNotFound error starting Rails v4.1.0 server on Windows

*爱你&永不变心* 提交于 2019-11-26 17:25:39
I have created a new application using Ruby on Rails v4.1.0. When attempting to start a server or console on Windows, I am encountering the following error: $ rails server Booting WEBrick Rails 4.1.0 application starting in development on .... Exiting c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:199: in `rescue in create_default_data_source': No timezone data source could be found. To resolve this, either install TZInfo::Data (e.g. by running `gem install tzinfo-data`) or specify a zoneinfo directory using `TZInfo::DataSource.set(:zoneinfo,

Rails 4 - Gem::LoadError: Specified &#39;mysql2&#39; for database adapter, but the gem is not loaded

血红的双手。 提交于 2019-11-26 15:11:55
问题 In my gemfile I have: gem 'mysql2' My database.yml is as follows: default: &default adapter: mysql2 database: <%= ENV['db_name'] %> username: <%= ENV['db_user'] %> password: <%= ENV['db_pass'] %> host: <%= ENV['db_host'] %> pool: 32 socket: <%= ENV['socket'] %> development: <<: *default production: <<: *default I've run both bundle update and bundle install and my Gemfile.lock shows mysql2. However when I run rake db:migrate I get this on both my computer and on the staging server: myproject