sass #import issue - ruby-on-rails-3

So I've been using sass on my site for a while with no problems. I've had this working for about a year.
app/assets/stylesheets/application.css
/*
*= require_self
*= depend_on sitewide.css.scss
*/
#import "sitewide.css.scss";
Recently I added a gem, and I seem to recall the sass gem getting updated as a result of installing this new gem (simple_form).
When I went to precompile assets in production, the import barfed complaining it couldn't find 'sitewide.css.scss'
I had to modify the #import to:
#import "app/assets/stylesheets/sitewide.css.scss";
To get my assets compiled, and the production site works fine now.
BUT
Now development is broken!
ActionController::RoutingError (No route matches [GET]
"/assets/app/assets/stylesheets/sitewide.css.scss"):
config/initializers/quiet_assets.rb:6:in `call_with_quiet_assets'
Development and production have both been bundle updated so all the gems are (should be?) identical
So this has to be an issue with my environments/development.rb???
It contains the following relating to assets config:
config.assets.compress = false
config.assets.debug = true
What happened?
Here is bundle show:
Ascii85 (1.0.2)
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activerecord-sqlserver-adapter (3.2.10)
activeresource (3.2.8)
activesupport (3.2.8)
addressable (2.3.2)
afm (0.2.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
builder (3.0.4)
bundler (1.0.21)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
devise (2.0.4)
erubis (2.7.0)
execjs (1.4.0)
hashery (2.1.0)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.4)
json (1.7.6)
kaminari (0.14.1)
libxml-ruby (2.3.3)
mail (2.4.4)
mime-types (1.19)
multi_json (1.5.0)
mysql2 (0.3.11)
orm_adapter (0.0.7)
pdf-reader (1.3.0)
polyglot (0.3.3)
prawn (0.12.0)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.8)
railties (3.2.8)
rake (10.0.3)
rdoc (3.12)
ruby-rc4 (0.1.5)
sass (3.2.5)
sass-rails (3.2.5)
simple_form (2.0.4)
sprockets (2.1.3)
thor (0.16.0)
tilt (1.3.3)
tiny_tds (0.5.1)
treetop (1.4.12)
ttfunk (1.0.3)
tzinfo (0.3.35)
uglifier (1.3.0)
warden (1.1.1)

Try to rename your app/assets/stylesheets/application.css to app/assets/stylesheets/application.css.scss and remove the absolut path in your import.
You have to move/rename it. If you leave your old file "applcation.css" in the directory, you will get the same errors. Plain CSS file are not handled the same way as scss or sass files. If you want to use #import feature of scss or sass, you have to change the file extension.

Related

rake assets:precompile not working always showing : read': No such file or directory - assets:precompile:all

I am using ubuntu 64-bit machine using, rvm, ruby 1.9.3-p448 , rails 3.2.13
And am not able to precompile assets.
I used following commands but got same error always :-
rake assets:precompile RAILS_ENV=production
rake assets:precompile
bundle exec rake assets:precompile
mymachine:~/mymachine-rails/prod$ bundle exec rake assets:precompile --trace
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails
4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See
the release notes for more on this:
http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released.
(called from at
/home/mymachine/mymachine-rails/prod/Rakefile:7)
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/bin/ruby /home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks
assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
read': No such file or directory - assets:precompile:all
(Errno::ENOENT)
from /home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
'
rake aborted!
Command failed with status (1): [/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/...]
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in
block in create_shell_runner'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in
call'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in
sh'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:insh'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils.rb:82:in
ruby'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:inruby'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in ruby_rake_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:ininvoke_or_reboot_rake_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in block (2 levels) in <top (required)>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:236:in
call'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:236:in
block in execute'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:231:in
each'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:231:in
execute'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:175:in
block in invoke_with_call_chain'
/home/mymachine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:168:in
invoke_with_call_chain'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/task.rb:161:in
invoke'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:149:in
invoke_task'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
block (2 levels) in top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
each'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:106:in
block in top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:115:in
run_with_threads'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:100:in
top_level'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:78:in
block in run'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:165:in
standard_exception_handling'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/lib/rake/application.rb:75:in
run'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/gems/rake-10.1.0/bin/rake:33:in
<top (required)>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/rake:19:inload'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/rake:19:in <main>'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
eval'
/home/mymachine/.rvm/gems/ruby-1.9.3-p448#mymachine/bin/ruby_executable_hooks:14:in
`'
Tasks: TOP => assets:precompile
Gems List :-
*** LOCAL GEMS ***
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
acts-as-taggable-on (2.4.1)
acts_as_paranoid (0.4.2)
angularjs-rails (1.0.7)
arel (3.0.2)
bcrypt-ruby (3.1.1)
browser (0.2.0)
builder (3.0.4)
bundler (1.3.5)
bundler-unload (1.0.2)
cancan (1.6.10)
chronic (0.9.1)
climate_control (0.0.3)
cocaine (0.5.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.3)
columnize (0.3.6)
commonjs (0.2.6)
couchrest (1.1.3)
couchrest_model (1.1.2)
daemons (1.1.9)
debugger (1.6.1)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
devise (3.0.0)
em-synchrony (1.0.3)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (1.4.0)
executable-hooks (1.2.2)
faraday (0.8.7)
faye-websocket (0.6.2)
hashie (2.0.5)
hike (1.2.3)
hiredis (0.4.5)
httpauth (0.2.0)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (3.0.4)
jquery-ui-rails (4.0.4)
json (1.7.7)
jwt (0.1.8)
less (2.3.2)
less-rails (2.3.3)
libv8 (3.16.14.3 x86_64-linux, 3.11.8.17 x86_64-linux)
localtunnel (0.3)
magic_multi_connections (1.2.1)
mail (2.5.4)
masonry-rails (0.2.0)
mime-types (1.23)
mini_portile (0.5.1)
multi_json (1.7.7)
multipart-post (1.2.0)
mysql2 (0.3.13)
net-ssh (2.6.8)
net-ssh-gateway (1.2.0)
nokogiri (1.6.0)
oauth (0.4.7)
oauth2 (0.8.1)
omniauth (1.1.4)
omniauth-facebook (1.4.1)
omniauth-google-oauth2 (0.2.0)
omniauth-linkedin-oauth2 (0.0.2)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.1.1)
omniauth-twitter (1.0.0)
orm_adapter (0.4.0)
paperclip (3.5.0)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-offline (0.6.4)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.1.0)
rb-readline (0.4.2)
rdoc (3.12.2)
redis (3.0.4)
ref (1.0.5)
rest-client (1.6.7)
rsolr (1.0.9)
rubygems-bundler (1.3.2)
rvm (1.11.3.8)
sass (3.2.9)
sass-rails (3.2.6)
sprockets (2.2.2)
swipe-rails (0.0.5)
therubyracer (0.12.0, 0.11.4)
thin (1.5.1)
thor (0.18.1)
tilt (1.4.1)
time_diff (0.3.0)
treetop (1.4.14)
twitter-bootstrap-rails (2.2.7)
tzinfo (0.3.37)
uglifier (2.1.2)
warden (1.2.3)
websocket-driver (0.2.1)
websocket-rails (0.4.9)
whenever (0.8.4)
will_paginate (3.0.4)
Seems to be an RVM quirk. I ran into this using rvm + ruby 2.0.0-p247 and this worked for me:
rvm ruby-2.0.0-p247#global do gem install executable-hooks

rails g mongoid config error

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Master:blog shaunstanislaus$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.2.2)
Enter your password to install the bundled RubyGems to your system:
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bson (1.6.4)
Using bson_ext (1.6.4)
Using bundler (1.1.5)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.4)
Using rdoc (3.12)
Using thor (0.15.4)
Using railties (3.2.6)
Using coffee-rails (3.2.2)
Using jquery-rails (2.0.2)
Using mongo (1.0.9)
Using will_paginate (3.0.3)
Using mongoid (2.0.0.beta.19)
Using rails (3.2.6)
Using sass (3.1.20)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.2.7)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
Master:blog shaunstanislaus$ rails g mongoid:config
/Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configuration.rb:85:in
method_missing': undefined methodgenerators' for #
(NoMethodError)
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid/railtie.rb:13
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid.rb:89:in
require'
from /Library/Ruby/Gems/1.8/gems/mongoid-2.0.0.beta.19/lib/mongoid.rb:89
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in
each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in
each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in
require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in
require'
from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:in
require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24
from script/rails:6:inrequire'
from script/rails:6
how do i fix this?
i entered this command and error appears above.
Master:blog shaunstanislaus$ rails g mongoid:config
I have done trying to remove gemfile.loc
bundle install
rails g mongoid:config, came out this error again. still the same.
Master:blog shaunstanislaus$ rails g mongoid:config
/Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in require': /Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: odd number list for Hash (SyntaxError)
{ to: Config }))
^
/Library/Ruby/Gems/1.8/gems/mongoid-3.0.3/lib/mongoid.rb:148: syntax error, unexpected ':', expecting '}'
{ to: Config }))
^
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in require'
from /Users/shaunstanislaus/Desktop/code/blog/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24:inrequire'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
Remove your GemFile.lock, run bundle install. If you're running on the latest version of Rails (3.2?) and Ruby (1.9.3-p###) it should work.
The reason the "generator" commands for Mongoid isn't showing is most likely that the gem didn't install properly for the version of rails and ruby you have.
Check this out: Rails g failing for mongoid commands… – Dominic Tancredi 2
I have this set up
ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
bundle -v
Bundler version 1.1.5
bundle install succeeds; rake server still gives the error
/Users/avaranovich/.gem/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require': /Users/avaranovich/.gem/gems/mongoid-3.0.4/lib/mongoid.rb:148: odd number list for Hash (SyntaxError)
{ to: Config }))
I fixed this with typing bundle exec rails g mongoid:config

"uninitialized constant Users (NameError)" w/ Heroku deploy

I've built a basic Rails app with Mongoid, Devise and Omniauth for Facebook login. I've got no problem running it locally, but when I try to push to Heroku, I'm getting this error:
"/app/app/controllers/Users/omniauth_callbacks_controller.rb:1:in `': uninitialized constant Users (NameError)"
I've Googled the hell out of this with little luck. I've committed the User model, I've ran "heroku run rake db:migrate", etc. No luck. Here's my stack.
Ruby 1.9.2
Rails 3.2.1
Gemfile:
require 'rbconfig'
HOST_OS = RbConfig::CONFIG['host_os']
source 'https://rubygems.org'
gem 'rails', '3.2.1'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "bson_ext", ">= 1.6.1"
gem "mongoid"
gem "devise"
gem "zurb-foundation"
gem "omniauth"
gem 'omniauth-facebook'
gem 'gravatar_image_tag'
Gemfile.lock:
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.7)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bson (1.6.1)
bson_ext (1.6.1)
bson (~> 1.6.1)
builder (3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
devise (2.0.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
railties (~> 3.1)
warden (~> 1.1.1)
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
faraday (0.7.6)
addressable (~> 2.2)
multipart-post (~> 1.1)
rack (~> 1.1)
gravatar_image_tag (1.0.0)
hashie (1.2.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
mongo (1.6.1)
bson (~> 1.6.1)
mongoid (2.4.7)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
multi_json (1.2.0)
multipart-post (1.1.5)
oauth2 (0.5.2)
faraday (~> 0.7)
multi_json (~> 1.0)
omniauth (1.0.3)
hashie (~> 1.2)
rack
omniauth-facebook (1.2.0)
omniauth-oauth2 (~> 1.0.0)
omniauth-oauth2 (1.0.0)
oauth2 (~> 0.5.0)
omniauth (~> 1.0)
orm_adapter (0.0.7)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.2.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.1.15)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.32)
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.1.1)
rack (>= 1.0)
zurb-foundation (2.2.0.2)
jquery-rails (>= 1.0)
rails (~> 3.1)
PLATFORMS
ruby
DEPENDENCIES
bson_ext (>= 1.6.1)
coffee-rails (~> 3.2.1)
devise
gravatar_image_tag
jquery-rails
mongoid
omniauth
omniauth-facebook
rails (= 3.2.1)
sass-rails (~> 3.2.3)
uglifier (>= 1.0.3)
zurb-foundation
Controller:
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
# You need to implement the method below in your model
#user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
if #user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
sign_in_and_redirect #user, :event => :authentication
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
end
Any thoughts ?
I had this issue; I know it's a late answer but I wanted to add this for whoever needed it.
Make sure that your OmniauthCallbacksController IS IN A users FOLDER. "app/controllers/users/omniauth_callbacks_controller.rb"
Just thought I'd add that I had this issue and that the above solutions didn't work for me. It turns out the cause in my case was that Devise had capitalized the Users subfolder's name (/app/app/controllers/Users). Deleting the folder from git and then readding it with the proper lowercase name of "users" (/app/app/controllers/users) solved my issue.
Unlikely, but if you used "rails generate scaffold", or "rails generate controller" to create the controller, you need to "git add -A" to add all the newly created files to your repository. (1) git add -A (2) git commit -m "new files added" (3) git push [assuming you're also using a remote repo] (4) git push heroku master (5) heroku run rake db:migrate
This would be a "Rookie Mistake", but would explain the error above. Don't ask how I know!

how to make rails 3.0 default on mac?

Here are my gems when I type in gem list in the terminal:
* LOCAL GEMS *
abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.18)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
minitest (1.6.0)
mysql2 (0.3.7)
polyglot (0.3.2)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.8.7)
rdoc (3.9.3, 2.5.8)
rubygems-update (1.8.9)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)
Ruby -v: ruby 1.9.2
How come when I type rails -v it gives me: Rails 1.2.6? I need the 3.0 to be the default.
Try running:
gem uninstall rails -v 1.2.6
and see if that works. You can also look into RVM there is a RailsCast http://railscasts.com/episodes/200-rails-3-beta-and-rvm
It also may be necissary to use sudo on a mac like so:
sudo gem uninstall rails

Rails 3.1.0.rc4: 304 Not Modified. Is there any known working configuration?

Trying the basic example in rails 3.1 RC 4, I get the error
Compiled app/assets/javascripts/application.js
Served asset /application.js - 304 Not Modified
(same with .css and asset/rails.png on the default index page)
My workflow is:
rails new example -j
rails g Book name:string year:integer
rake db:migrate
I get this error on both linux 64bit and win7 32 bit.
I tried many suggestions, but couldn't get it working. Is there anyone out there able to manage this known issue? Any configuration that works (combination of gems or asset setting configuration)?
[Here's my win7 gemlist:
abstract (1.0.0)
actionmailer (3.1.0.rc4)
actionpack (3.1.0.rc4)
activemodel (3.1.0.rc4)
activerecord (3.1.0.rc4)
activeresource (3.1.0.rc4)
activesupport (3.1.0.rc4)
arel (2.1.3)
bcrypt-ruby (2.1.4 x86-mingw32)
builder (3.0.0)
bundler (1.0.15)
coffee-script (2.2.0)
coffee-script-source (1.1.1)
erubis (2.7.0)
execjs (1.2.0)
hike (1.1.0)
i18n (0.6.0)
jquery-rails (1.0.12)
json (1.5.3)
mail (2.3.0)
mime-types (1.16)
multi_json (1.0.3)
polyglot (0.3.1)
rack (1.3.0)
rack-cache (1.0.2)
rack-mount (0.8.1)
rack-ssl (1.3.2)
rack-test (0.6.0)
rails (3.1.0.rc4)
railties (3.1.0.rc4)
rake (0.9.2)
rdoc (3.7)
sass (3.1.3)
sass-rails (3.1.0.rc.3)
sprockets (2.0.0.beta.10)
sqlite3 (1.3.3 x86-mingw32)
thor (0.14.6)
tilt (1.3.2)
treetop (1.4.9)
tzinfo (0.3.29)
uglifier (1.0.0)
win32-open3 (0.3.2 x86-mingw32)]
A 304 message isn't an error. When most modern browsers request a file, they also send the file's "ETag" with it to identify the version the browser currently has. If the browser's requested ETag matches the ETag on the server version, the browser will just send the 304 message instead of serving the actual file.
Essentially, it's just your app telling the browser/client "Hey, this resource hasn't changed at all since the last time you requested it, so just use your cached version. If you don't have one, then request the file again (without the ETag) and I'll give it to you."
Is something actually preventing your app from working?