With Rails 3, after upgrading from Mongoid 2.x to Mongoid 3.x, my Heroku + MongoHQ setup stopped working. Funny thing is, that my development & test frameworks and my whole test suite passes just fine.
I suspect the problem is with my mongoid.yml file, but I've tried searching the docs, google & stackoverflow, and used all the suggested formats, including this: heroku mongohq and mongoid Mongo::ConnectionFailure or actually this: https://gist.github.com/2900804
UPDATED July 16th: This is how my mongoid.yml file looks, after trying multiple things + After what Jason from MongoHQ suggested:
development:
sessions:
default:
database: development
hosts:
- localhost:27017
test:
sessions:
default:
database: test
hosts:
- localhost:27017
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
options:
skip_version_check: true
safe: true
(to my understanding, it is essentially the same as the one in the links above, except that it uses the uri; I tried the other way, splitting the MONGOHQ_URL into the separate fields as well, but it didn't help)
I've tried setting mongoid as 3.0.0rc and leaving the version blank in my Gemfile. Using the github version failed due to HTTPS certificates or something, so I didn't bother trying it multiple times.
What the action controller says is this:
Moped::Errors::OperationFailure in Home#index
Showing /app/app/views/home/index.html.haml where line #2 raised:
The operation: #<Moped::Protocol::Command
#length=68
#request_id=4
#response_to=0
#op_code=2004
#flags=[:slave_ok]
#full_collection_name=".$cmd"
#skip=0
#limit=-1
#selector={:count=>:posts, :query=>{}}
#fields=nil>
failed with error "db assertion failure"
and when I run
heroku run console
.. I get this:
irb(main):052:0> Location.create!
NoMethodError: undefined method `[]' for nil:NilClass
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:74:in `block in command'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:522:in `[]'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:522:in `block (3 levels) in flush'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:521:in `map'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:521:in `block (2 levels) in flush'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:113:in `ensure_connected'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:517:in `block in flush'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:532:in `logging'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:516:in `flush'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:505:in `process'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:70:in `command'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/node.rb:356:in `refresh'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/cluster.rb:101:in `block in refresh'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/cluster.rb:114:in `each'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/cluster.rb:114:in `refresh'
from /app/vendor/bundle/ruby/1.9.1/gems/moped-1.1.1/lib/moped/cluster.rb:67:in `nodes'
... 15 levels...
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:405:in `__run_callback'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/callbacks.rb:98:in `run_callbacks'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/persistence/insertion.rb:23:in `prepare'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/persistence/operations/insert.rb:26:in `persist'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/persistence.rb:50:in `insert'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/persistence.rb:251:in `block in create!'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/threaded/lifecycle.rb:173:in `_creating'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.1/lib/mongoid/persistence.rb:249:in `create!'
from (irb):52
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.6/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'irb(main):053:0>
I think I've googled everything, run through multiple github mongoid issues, read the documentation multiple times ... and I'm running out of ideas here.
Anything come to mind I should try next?
UPDATE July 16th: this is what Heroku says when I git push heroku master (After doing what Jason from MongoHQ suggested):
git push heroku master
Counting objects: 7, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 372 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.pre
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
# ... shortened this #
Using libv8 (3.3.10.4)
Using moped (1.1.2)
Using origin (1.0.4)
Using mongoid (3.0.0.rc)
Using omniauth (1.1.0)
Using quimby (0.4.5)
Using bundler (1.2.0.pre)
Using rails (3.2.6)
Using therubyracer (0.10.1)
Using thin (1.3.1)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (31.24s)
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size is 18.7MB
-----> Launching... done, v92
http://xxxxx.herokuapp.com deployed to Heroku
To git#heroku.com:xxxxx.git
b2d97xy..7b0aczy master -> master
UPDATE 2 July 16th: did as Jason & MrKurt said (first forgot to run bundle update mongoid, but that didn't help either). Now the error changed, though:
NoMethodError in Home#index
Showing /app/app/views/home/index.html.haml where line #2 raised:
undefined method `[]' for nil:NilClass
Extracted source (around line #2):
1: %h1 Most recent posts
2: - if #posts.length > 0
You will need to use Ruby 1.9.3. See Mongoid documentation here and Heroku documentation here on how to use 1.9.3.
I was also getting similar errors, and I changed my gemfile to include ruby '1.9.3' and everything worked as expected again.
Edit:
#herb pointed out that you need the latest version of bundler for this to work (gem install bundler --pre). Otherwise, ruby '1.9.3' in your Gemfile will not work.
Try adding an "options" area to the default session and add "skip_version_check: true" as one of the options.
Jason
MongoHQ
As a workaround, hardcoding the uri from heroku config seems to do the trick.
ex:
production:
sessions:
default:
uri: "mongodb://heroku:xxxx#domain.mongohq.com:000/appyyyy"
options:
skip_version_check: true
safe: true
I'm guessing the nilclass error was because <%= ENV['MONGOHQ_URL'] %> was returning nil
Related
I was deploying my Rails application on Heroku and the deploy failed with this error message.
Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your ERB.
I have deployed continuously on Heroku for over a year and no major changes were made.
The change involved updating the gemfile from ruby '2.6.3' to ruby '3.1.2'.
Here is the full trace
Building on the Heroku-22 stack
Using buildpacks:
1. heroku/ruby
2. heroku/nodejs
Ruby app detected
Installing bundler 2.3.10
Removing BUNDLED WITH version in the Gemfile.lock
Compiling Ruby/Rails
###### WARNING:
Your app was upgraded to bundler 2.3.10.
Previously you had a successful deploy with bundler 2.2.21.
If you see problems related to the bundler version please refer to:
https://devcenter.heroku.com/articles/bundler-version#known-upgrade-issues
Using Ruby version: ruby-3.1.2
Purging Cache. Changing stack from heroku-18 to heroku-22
Installing dependencies using bundler 2.3.10
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
A bunch of gems fetching and installing
Bundle complete! 22 Gemfile dependencies, 78 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from mailjet:
The Ruby wrapper for Mailjet has just been installed successfully, congrats!
Maybe you want to configure your credentials to use your account.
All informations available on https://github.com/mailjet/mailjet-gem.
But if you are using Rails, you'll be glad to generate it easily using:
$ rails generate mailjet:initializer
We hope you will enjoy Mailjet!
Bundle completed (86.70s)
Cleaning up the bundler cache.
Installing node-v16.13.1-linux-x64
Installing yarn-v1.22.17
Detecting rake tasks
Preparing app for Rails asset pipeline
Running: rake assets:precompile
Rails couldn't infer whether you are using multiple databases from your database.yml and can't generate the tasks for the non-primary databases. If you'd like to use this feature, please simplify your ERB.
rake aborted!
Psych::BadAlias: Unknown alias: default
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/env.rb:30:in `available_environments'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/env.rb:21:in `current'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/env.rb:15:in `inquire'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/env.rb:7:in `inquire'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/instance.rb:11:in `env'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/instance.rb:18:in `config'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker.rb:34:in `config'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/webpacker-4.3.0/lib/webpacker/railtie.rb:32:in `block in <class:Engine>'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/initializable.rb:32:in `instance_exec'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/initializable.rb:32:in `run'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/initializable.rb:60:in `run_initializers'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/application.rb:363:in `initialize!'
/tmp/build_f6d25fed/config/environment.rb:5:in `<main>'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.5.1/lib/active_support/dependencies.rb:324:in `block in require'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.5.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.5.1/lib/active_support/dependencies.rb:324:in `require'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/application.rb:339:in `require_environment!'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/railties-6.0.5.1/lib/rails/application.rb:523:in `block in run_tasks_blocks'
/tmp/build_f6d25fed/vendor/bundle/ruby/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
It was a compatibility issue with the new ruby version, just adding the psych gem fixed this.
gem 'psych', '< 4'
I have a problem to run unicorn on Ubuntu 16. When trying to run it - either manually (service unicorn_myapp_staging restart) or through Capistrano, I get this message: You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError) (below is the full error track)
/home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/lockfile_parser.rb:95:in `initialize'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:72:in `new'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:72:in `initialize'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:200:in `new'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:200:in `to_definition'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/dsl.rb:12:in `evaluate'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/definition.rb:33:in `build'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:128:in `definition'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler.rb:94:in `setup'
from /home/deployer/.rvm/gems/ruby-2.3.3/gems/bundler-1.14.3/lib/bundler/setup.rb:20:in `<top (required)>'
from /home/deployer/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/deployer/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
If I check the version of bundler, it seems to be fine:
bundle info bundler
* bundler (2.1.4)
Summary: The best way to manage your application's dependencies
Homepage: https://bundler.io
Path: /home/deployer/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4
However, as is stated on the error message above, it looks that the used versions of ruby and bundler are old (2.3.3 and 1.14.3) compared to the newly upgraded ruby (2.6.3) and bundler (2.1.4).
Where do I set the correct versions of ruby and bundler for starting Unicorn? Is there a hidden config file on Ubuntu, where I need to specify it?
Try this fix, looks like issue with Gemfile.lock. Try removing BUNDLED WITH from gemfile.lock.
Remove something like and build again
BUNDLED WITH
2.1.4
This question is related to this one, but the proposed solutons didn't work for me.
I'm trying to deploy a Rails 5.2 application with Ruby 2.6.1, but I keep getting this error in the deployment phase:
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/lockfile_parser.rb:95:in `initialize'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/definition.rb:83:in `new'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/definition.rb:83:in `initialize'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/dsl.rb:234:in `new'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/dsl.rb:234:in `to_definition'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/dsl.rb:13:in `evaluate'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/definition.rb:34:in `build'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler.rb:135:in `definition'
from /app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler.rb:101:in `setup'
from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/bundler/setup.rb:20:in `<top (required)>'
from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /app/vendor/ruby-2.6.1/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /app/config/boot.rb:3:in `<top (required)>'
from /app/bin/rake:2:in `require_relative'
from /app/bin/rake:2:in `<main>'
What I find strange in this error is this line:
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.1/lib/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
Heroku seems to say it is using Ruby 2.6.0. But in the build phase, it says it uses Ruby 2.6.1 with Bundler 2:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.6.1
-----> Installing dependencies using bundler 2.0.1
The build is successful, but the deployment is in failure.
Here is how is configured my app.
Gemfile (reduced to what matters)
ruby "2.6.1"
gem 'rails', '~> 5.2'
Gemfile.lock (reduced to what matters)
RUBY VERSION
ruby 2.6.1p33
BUNDLED WITH
2.0.1
On heroku, my buildpack is heroku/ruby. My stack is heroku-18.
Heroku seems to be supporting Bundler 2, as said in this post.
Any idea on what could fail in the deployment?
I found a solution. The problem was at deploy time, not during the build. The deployment was using Ruby 2.6.0, because of Heroku's web dyno that is by default:
rails server -p $PORT -e $RAILS_ENV
Yet, this post from bundler github is telling to prefix every single command with bundle exec. But the rails server command from the dyno is not prefixed so.
A workaround I found is modifying the project Procfile file, and add the following line:
web: bundle exec rails server -p $PORT -e $RAILS_ENV
This way, the rails server command uses the expected Ruby version, the 2.6.1 insteand of the 2.6.0 that generated the error.
I have an "angular of rails" app using foundation-sites which I'm installing with bower.
Whenever I try to push to heroku, it breaks on running rake assets:precompile with the following error:
remote: rake aborted!
remote: Sass::SyntaxError: $color: "foreground(#09798e)" is not a color for `red'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/assets/bower_components/foundation-sites/scss/util/_color.scss:19:in `foundation-badge'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/app/assets/stylesheets/foundation_and_overrides.scss:21
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/app/assets/stylesheets/cguides.scss:1
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb:310:in `reformat_argument_error'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb:149:in `rescue in _perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb:123:in `_perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/node.rb:58:in `perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `block in _perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `map'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb:63:in `_perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/node.rb:58:in `perform'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:471:in `visit_variable'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb:36:in `visit'
remote: /tmp/build_2017bed0c047fd92960507e2e0ee8a54/vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
...
However, when I run RAILS_ENV=production bundle exec rake assets:precompile locally, it goes through with no glitch, making the situation totally confusing to me.
In my bower.json file, I have: "foundation-sites": "latest",
Suffice it to say however, that when I entered heroku bash and checked the contents of vendor/assets/bower_components/foundation-sites/scss/util/_color.scss, it's slightly different from my local version. but no mention of the complained $color: "foreground(#09798e)" in the file.
At the moment, I'm resigned to precompiling the assets locally before push, but it's getting too cumbersome and I need to figure this out.
Thanks.
I had the same problem running my rails app locally. It looks like this error is due to a syntax change between gem foundation-rails 6.2.4 and 6.3.0.
I fixed this by specifying 6.2.4 in my Gemfile:
gem 'foundation-rails', '~> 6.2.4'
hi i have installed metric_fu om a rails 2.2 system running hobo and i just can't get to run the metrics command. this is my log:
$:apfcool $item rake metrics:all
(in /Users/$/Documents/apf/apfcool)
* master
/Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:171:in `process_sexp': undefined method `<' for nil:NilClass (NoMethodError)
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:309:in `[]'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:309:in `deep_each'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:318:in `each_sexp'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:315:in `each'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:315:in `each_sexp'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:308:in `deep_each'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:169:in `process_sexp'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:144:in `process'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:121:in `each'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/lib/flay.rb:121:in `process'
from /Users/$/.gem/ruby/1.8/gems/flay-1.4.0/bin/flay:10
from /usr/bin/flay:19:in `load'
from /usr/bin/flay:19
rake aborted!
undefined method `first' for nil:NilClass
i google a lot and found this http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/8e7ba74ea6ba58a1 but that "fix" doesn't even get the line or method name right.
I got this problem when I upgraded to Snow Leopard. I fixed it by removing and reinstalling the sexp_processor and ParseTree gems. They do some low level stuff, so if ground beneath them moves you need to reinstall.
gem uninstall sexp_processor
gem uninstall ParseTree
Then:
gem install sexp_processor
gem install ParseTree
Depending on how you store gems, you may want to put 'sudo' in front of those commands.