I'm am getting an error in production that doesn't occur in development. It appears in the stack trace that the gem is using the wrong version of ruby (2.1.0), but I have specified 2.1.3 in my gemfile and followed the heroku troubleshooting on ruby versions. Based on other stackoverflow information the ruby version makes a difference here. Anyone know how to update app/vendor/bundle to the latest?
This is my error which is occurring in a Resque worker...
undefined method `name' for nil:NilClass
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:72:in `block in initialize'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `yield'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `block in initialize'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `yield'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `block in initialize'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `yield'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:74:in `block in initialize'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:150:in `yield'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:150:in `accept'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych/visitors/yaml_tree.rb:114:in `push'
/app/vendor/bundle/ruby/2.1.0/gems/psych-2.0.6/lib/psych.rb:409:in `dump'
...snip...
This is my ruby version...
heroku run "ruby --version"
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]
This is what's in /app/vendor/bundle...
heroku run "ls /app/vendor/bundle/ruby"
2.1.0
This is my Gemfile ruby declaration....
source 'https://rubygems.org'
group :default do
# current stable (heroku needs this listed)
ruby '2.1.3'
gem 'rails', '4.1.1'
gem 'redis' # queue mechanism
gem 'resque', "~> 1.22.0", :require => "resque/server"
gem 'resque_mailer' # mailer queue
gem 'resque-scheduler' # job scheduler
# postgres and database
gem 'pg' # postgres
gem 'activerecord-import' # bulk sql insert
gem 'seed-fu', '~> 2.3' # db seed data
# APIs
gem 'bitly'
gem 'feedjira' # RSS feeds
gem 'fullcontact'
gem 'httparty'# rest api client
gem 'twilio-ruby' # SMS
gem 'twitter'
gem 'twitter-text' # convert twitter, links, hashtags and users
gem 'yahoo-finance', require: 'yahoo_finance'
# WEB....
# Use unicorn as the app server
gem 'unicorn'
# javascript
gem 'jquery-rails'
gem 'uglifier', '>= 1.3.0' # compressor for js assets
gem 'coffee-rails', '~> 4.0.0'
# UI/CSS
gem 'sass-rails', '~> 4.0.0'
gem 'bootstrap-sass'
gem 'jquery-ui-rails'
gem 'jqcloud-rails' # word cloud
gem 'footable-rails' # mobile responsive table
gem 'font-awesome-sass'# icons
gem 'highcharts-rails'
# rails
gem 'turbolinks'
gem 'simple_form'
# admin interface
gem 'rails_admin' # models admin interface
gem "psych", "~> 2.0.5" # needed for rails_admin
# user authentication
gem 'devise'
gem 'domp'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-stocktwits', :git => 'https://github.com/jesseyoungmann/omniauth-stocktwits.git'
# app support
gem 'bcrypt', '~> 3.1.2' # for active model secure password
gem 'kaminari', :git => 'https://github.com/musicglue/kaminari.git' # pagination
end
# docs
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# test
group :test do
gem "capybara"
gem 'factory_girl_rails'
gem 'faker'
gem 'rspec-rails'
gem 'selenium-webdriver'
gem 'simplecov', :require => false
gem 'vcr', '~> 2.8.0'
gem 'webmock', '~> 1.15.0'
end
# development
group :development do
gem 'foreigner', '~> 1.6.1' # foreign key generator
gem 'rails_layout'
# profilers
gem 'rack-mini-profiler'
gem 'ruby-prof'
end
group :production do
gem 'newrelic_rpm'
gem 'rails_12factor' # heroku
end
Thanks!
A possible solution is to create a .ruby-version file in the root of your application and simply put 2.1.3 in it, than your app will always use that version in production and development. I had similar issues in the past and this did the trick for me.
Duplicate of this:
Why Do Heroku Stack Traces indicate Ruby 1.9.1 is in use?
Same answer as this:
Why are we installing Ruby 1.9.2/1.9.3 gems into a 1.9.1 folder?
Related
I'm not actually a ruby dev, I'm just trying to get development environment setup from a project and I'm having a world of trouble getting the gems in order so I can load up the server. I do mostly front-end work. Anyways, my error is:
There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
I've been searching google for last two days and can't come across anyone experiencing this issue with "ahoy_matey" gem. I get this error when trying to launch the server or rake migrations.
Ruby 1.9.3
Rails 3.2.13
mysql2 0.3.17
Any help is appreciated.
Full trace:
Bundler::GemRequireError: There was an error while trying to load the gem 'ahoy_matey'.
Gem Load Error is: undefined method `hours' for 4:Fixnum
Backtrace for gem load error is:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:43:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy.rb:39:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/ahoy_matey-1.1.0/lib/ahoy_matey.rb:1:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:689:in `raw_load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:93:in `load_rakefile'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:77:in `block in run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/rake-11.1.2/bin/rake:33:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `load'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/rake:23:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
Bundler Error Backtrace:
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:90:in `rescue in block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:81:in `block in require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `each'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler/runtime.rb:70:in `require'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/gems/bundler-1.12.1/lib/bundler.rb:102:in `require'
/home/sirtastic/projects/dataraptor/config/application.rb:7:in `'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `require'
/home/sirtastic/projects/dataraptor/Rakefile:5:in `'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `eval'
/home/sirtastic/.rvm/gems/ruby-1.9.3-p551#dr/bin/ruby_executable_hooks:15:in `'
(See full trace by running task with --trace)
source 'http://rubygems.org'
gem 'rails', '3.2.13'
gem 'mysql2'#, '~> 0.3.11'
gem 'sass-rails', '~> 3.2.3' # Because SCSS is compiled for embedded quoters
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'execjs', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails', '~> 3.0.4'
gem 'jquery-ui-rails', '~> 4.0.5'
gem 'jquery_datepicker'
group :production do
gem 'pry', require:false
end
group :development, :test do
gem 'capybara', :require => false
gem 'database_cleaner', :require => false # for use with capybara tests
gem 'factory_girl', '~> 4.1' # for generating test models
gem 'factory_girl_rails', require:false
gem 'forgery' # for generating test data
gem 'pry'
gem 'pry_debug'
gem 'pry-nav'
gem 'spork-rails', platform: [:mswin, :mingw] # Fast rpsec testing on Windows
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :development do
gem 'thin' # Sane development server
gem 'bullet' # for identifying areas to speed up database queries
gem 'meta_request' # for chrome rails-panel
gem 'rack-mini-profiler', require:false
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :test do
gem 'launchy', :require => false
gem 'rspec-rails'
gem "selenium-webdriver", "~> 2.40.0" # for AJAX testing
gem 'shoulda', :require => false
gem 'simplecov', :require => false # Test coverage
gem 'timecop'
gem 'vcr', '~> 2.9.3'#'~> 2.5.0'
gem "webmock", '~> 1.10.2'
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
end
group :dev, :release, :development do
gem 'better_errors'
gem 'binding_of_caller' # supports better errors by providing IDE in browser when error occurs
end
gem 'activeuuid', '>= 0.5.0'
gem 'ahoy_matey', '1.1.0' #needs this exact version in order to output UUIDs consistently. the next version after does not.
gem 'american_date' # by default, dates are parsed/formatted with American style
gem 'angularjs-rails', '~> 1.0.7'
gem 'attr_encrypted', '~> 1.2' # encrypt activerecord attributes in db
gem 'authlogic', '~> 3.2' # user login
gem 'aws-sdk'
gem 'capistrano', require: false# deployment of application
gem 'capistrano-ext', require: false
gem 'carrierwave' # file upload solution
gem 'daemons' # used for running delayed_job jobs
gem 'encryptor', '~> 1.1' # handle encryption of ActiveRecord fields
gem 'exception_notification', '~> 4.0.0'
gem 'faraday' # REST client for interfacing with external APIs
gem 'faraday_middleware'
gem 'fog', '~> 1.22' # for Amazon Web Services cloud storage
gem 'formatador', '~> 0.2' # This shouldn't need to be here. It is/was a dependency for fog-core, but it wasn't getting bundled (for some reason), so raking assets:precompile consistently failed. 2014-09-17.
gem 'haml', '~> 4.0.3'
gem 'holidays', '~> 2.1.0'
gem 'httpi', '~> 2.2.7'
gem 'json', '~> 1.8.1' # Specified so as to 'safely' conduct an update for the sake of stripe gem (2014-05-21)
gem 'liquid', '~> 2.5.0' # rendering templates, such as Marketing::Email::Template
gem 'mini_magick' # photo resizing
gem 'momentjs-rails'
gem 'multi_xml'
gem 'paperclip', '~> 3.5.0' # handle file attachments to activerecord
gem "paypal-recurring"
gem 'nested_form'
gem 'rails3-jquery-autocomplete'# supports autocomplete fields
gem 'redis' # for publishing
gem 'remotipart', '~> 1.0' # enables multipart form submissions over ajax
gem 'ruby-saml', '~> 1.0.0'
gem 'rvm-capistrano', require: false # for deploying to servers where multiple rubies are available
gem 'safe_attributes' # takes care of attribute name collisions w/ ActiveRecord (we use 'delay')
gem 'savon', '~> 2.7'
gem "select2-rails" # makes an autocomplete select box, compatible with x-editable
gem 'sidekiq', '~> 2.17.0' # handles background/delayed jobs
gem 'spreadsheet', require: false
gem "stripe", '~> 1.11.0'
gem 'tinymce-rails', '>= 4.0.8' # version 4.0.8 includes important bug fixes
gem 'transaction_retry' # Catch mysql deadlock and try again
gem 'tzip', '~> 0.0.4' # Find timezone by zip code
gem 'whenever', require: false # handles scheduled tasks
gem 'wicked_pdf' # creates pdfs from html (is a wrapper for wkhtmltopdf)
gem 'will_paginate', '~> 3.0' # paginates index pages for activerecord
gem 'wkhtmltopdf-binary' # the backend linux tool that creates pdfs from html using QT Webkit rendering engine
#### DON'T JUST ADD GEMS TO THE END OF THIS LIST! ALPHABETIZE! ###
Looks like you might be requiring your bundle before requiring rails. If you have these two lines in your application.rb file, they need to be in this order:
require 'rails/all'
Bundler.require(:default, Rails.env)
So I see you're running just rails s. I know this question is old but maybe this might help someone else. So the command you want to be running is:
bundle exec rails s
bundle exec executes a command in the context of the bundle.
This command executes the command, making all gems specified in the Gemfile available to require in Rails.
Essentially, if you would normally have run something like rspec spec/my_spec.rb, and you want to use the gems specified in the Gemfile and installed via bundle install, you should run bundle exec rspec spec/my_spec.rb.
Note that bundle exec does not require that an executable is available on your shell's $PATH.
Source
Im trying to get setup on an existing ruby on rails project, but am getting hung up on the postgres db setup. I used RVM to set up the project with ruby 2.1.2. Installed the pg gem with homebrew using the following command:
gem install pg -- --with-pg_config=/usr/local/bin/pg_config
My database.yml file looks like this:
development:
adapter: postgresql
encoding: unicode
database: myapp_development
pool: 5
username: myusername
password:
test:
adapter: postgresql
encoding: unicode
database: myapp_test
pool: 5
username: myusername
password:
I bundle installed all my gems.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
gem 'activerecord-session_store'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# authentication using Devise (email / password) and omniauth (oauth)
gem "devise", '~> 3.2.0'
gem 'devise_invitable', '~> 1.3.0'
gem "beta_invites", :github=>'danman01/beta_invites'
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem "omniauth-soundcloud"
# validation for emails
gem 'valid_email'
# set env variables within config/application.yml
gem "figaro"
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
# User roles. ex: User.first.add_role!("admin")
gem "easy_roles"
# manage meta tags
gem "meta-tags", :require => "meta_tags"
# error notification. TODO - setup https://github.com/smartinez87/exception_notification
gem 'exception_notification', git: "git://github.com/smartinez87/exception_notification.git"
# nice rails urls for seo and readability
gem "friendly_id", '~> 5.0.0'
# use foreman start to startup multiple processes at once (i.e. rails and delayed job queue)
gem "foreman"
gem "nokogiri", '~> 1.6.3'
# pagination
gem "kaminari"
# admin panel, available at /admin
gem "rails_admin"
# cron scheduling for the server. See config/schedule
gem 'whenever', :require =>false
# tool to party
gem 'httparty'
gem 'simple_form'
gem 'bootstrap-sass', '~> 3.1.1'
# app permissions. set in models/ability.rb
gem 'cancancan', '~> 1.8'
# caching
gem 'dalli'
# activity feed
gem 'public_activity'
# image upload
gem 'carrierwave'
gem 'carrierwave-aws'
gem 'mini_magick'
gem "sidekiq"
gem 'sinatra', require: false
gem 'slim'
# tree structure
gem "ancestry"
# more organized db seeds
gem "seedbank"
# run code safely in migrations
gem 'migration_data'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :development do
# better formatting of errors
gem "better_errors"
# do not output so much about assets to console
gem "quiet_assets"
# debugging tool: https://github.com/banister/binding_of_caller
gem "binding_of_caller"
gem "tracer_bullets"
end
group :development, :test do
gem 'rspec-rails'
gem "faker"
gem "factory_girl_rails", "~> 4.0"
gem "pry-rails"
gem 'pry-byebug'
# preload rails app to speed things up
gem "spring"
gem "spring-commands-rspec"
# auto run things
gem "guard"
gem "guard-rspec", require: false
gem 'rb-fsevent' if `uname` =~ /Darwin/
gem 'thin' # or thin
end
group :development, :production do
gem 'cohort_me'
end
group :test do
gem 'capybara'
gem "launchy"
gem "database_cleaner"
end
# Rails view utilities
# use country-select with priority countries like: country_select("user", "country_name", [ "United Kingdom", "France", "Germany" ])
gem 'country-select'
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
gem 'unicorn'
# random comment
# Use Capistrano for deployment
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano', '~>3.1'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rvm'
gem 'capistrano-sidekiq', github: 'seuros/capistrano-sidekiq'#
# gem 'rails_12factor', group: :production
# ruby '2.1.1'
gem 'rb-fsevent'
I started the postgres server manually using:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
The logfile outputs this:
ERROR: database "myapp_development" already exists
STATEMENT: CREATE DATABASE "musictown_development" ENCODING = 'unicode'
ERROR: database "myapp_test" already exists
STATEMENT: CREATE DATABASE "musictown_test" ENCODING = 'unicode'
Alternatively i used the postgresapp to start the server.
And when I run rake db:setup I get this:
myapp_development already exists
myapp_test already exists
It creates a bunch of tables and indexes then when it gets here it stops:
-- initialize_schema_migrations_table()
-> 0.0154s
rake aborted!
Errno::ENOENT: No such file or directory - identify
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/subexec-0.2.3/lib/subexec.rb:71:in `spawn'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/subexec-0.2.3/lib/subexec.rb:71:in `spawn'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/subexec-0.2.3/lib/subexec.rb:55:in `run!'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/subexec-0.2.3/lib/subexec.rb:41:in `run'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:405:in `run'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:399:in `run_command'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:184:in `valid?'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:140:in `create'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:47:in `read'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:111:in `block in open'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:110:in `open'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/mini_magick-3.8.0/lib/mini_magick/image.rb:110:in `open'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/processing/mini_magick.rb:260:in `manipulate!'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/processing/mini_magick.rb:153:in `resize_to_fit'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/processing.rb:84:in `block in process!'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/processing.rb:76:in `each'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/processing.rb:76:in `process!'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:18:in `block in with_callbacks'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:18:in `each'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:18:in `with_callbacks'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/uploader/cache.rb:122:in `cache!'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:329:in `cache'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:163:in `image='
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.10.0/lib/carrierwave/orm/activerecord.rb:39:in `image='
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/attribute_assignment.rb:42:in `public_send'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/attribute_assignment.rb:42:in `_assign_attribute'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/attribute_assignment.rb:29:in `block in assign_attributes'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/attribute_assignment.rb:23:in `each'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/attribute_assignment.rb:23:in `assign_attributes'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/core.rb:460:in `init_attributes'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/core.rb:185:in `initialize'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27:in `new'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27:in `new'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/activerecord-4.0.2/lib/active_record/persistence.rb:36:in `create'
/Users/myusername/Documents/MusicTown/musictown/db/seeds.rb:9:in `block in define_seed_task'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/seedbank-0.3.0/lib/seedbank/dsl.rb:24:in `module_eval'
/Users/myusername/.rvm/gems/ruby-2.1.2/gems/seedbank-0.3.0/lib/seedbank/dsl.rb:24:in `block in define_seed_task'
/Users/myusername/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/myusername/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:setup => db:seed => db:seed:common => db:seed:original
(See full trace by running task with --trace)
Maybe theres something wrong with one of the gems in the gemfile?
This question is sorta similar: Carrierwave, Rails 4; Errno::ENOENT (No such file or directory - identify). Maybe some gem is the wrong version?
To fix this, install ImageMagick CLI tools from here: imagemagick.org/script/binary-releases.php, Mac OS Binary Release. Installing with MacPorts, which adds the paths to my .bash_profile file. Now rake db:setup command is able to find ImageMagick, and works.
I'm getting following error in all models in my project when calling method ".create":
NoMethodError: undefined method `[]' for nil:NilClass
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/attribute_methods/read.rb:86:in `block in read_attribute'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/attribute_methods/read.rb:84:in `fetch'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/attribute_methods/read.rb:84:in `read_attribute'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/attribute_methods/primary_key.rb:19:in `id'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/transactions.rb:341:in `remember_transaction_record_state'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/transactions.rb:280:in `rollback_active_record_state!'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/activerecord/lib/active_record/transactions.rb:269:in `save'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/gems/protected_attributes-1.0.3/lib/active_record/mass_assignment_security/persistence.rb:46:in `create'
from (irb):1
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/railties/lib/rails/commands/console.rb:90:in `start'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/railties/lib/rails/commands/console.rb:9:in `start'
from /home/pavelkhrulev/.rvm/gems/ruby-2.0.0-p195#spasibo/bundler/gems/rails-b52b0bebd147/railties/lib/rails/commands.rb:62:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Everything was working before, but i made bundle update and now it's not.
My gemfile:
ruby '2.0.0'
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', git: 'https://github.com/rails/rails.git', branch: '4-0-stable'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', git: 'https://github.com/rails/sass-rails.git'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
group :production do
gem 'therubyracer', platforms: :ruby
end
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Use heroku gem to make all features enabled
gem 'rails_12factor', group: :production
# New Relic perfomance monitor
gem 'newrelic_rpm'
# Application gems
gem "devise", :git => "http://github.com/plataformatec/devise.git"
gem 'protected_attributes'
gem 'russian'
gem 'devise-russian'
gem 'kaminari'
# Admin panel
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'ransack'
gem 'inherited_resources', github: 'josevalim/inherited_resources'
gem 'formtastic', github: 'justinfrench/formtastic'
I looked at the source code, used the google search, but still have no idea how to fix this. I will appreciate any help. I really stuck with it. I need to delivery project that was almost finished.
Ensure that your proteced_attributes gem is updated to the latest version. This rails issue acknowledges there was a compatibility bug.
in Gemfile can you please try
gem 'rails', '~> 4.0.0'
instead of
gem 'rails', git: 'https://github.com/rails/rails.git', branch: '4-0-stable'
then bundle install
*Edit: added comma in first statement
I'm a newby in Rails, and I'm developing some app with 3.2.0. So, all is good, it works on my local environment, but when I try to push it to Heroku there are troubles with assets - my css files don't compile into one application.css file, therefore my final application.css is clean (you can see it by link my app on Heroku). There are no problems on my local machine. I've found some answers in Google and people recommended do the following command:
RAILS_ENV=production bundle exec rake assets:precompile
I tried to do it and got the following output:
/Users/marya/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/marya/.rvm/gems/ruby-1.9.3-p448#global/bin/rake assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/Users/marya/.rvm/rubies/ruby-1.9.3-p448/b...]
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:9:in `ruby_rake_task'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:17:in `invoke_or_reboot_rake_task'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.0/lib/sprockets/assets.rake:25:in `block (2 levels) in <top (required)>'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:14:in `eval'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:14:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I don't understand what it does mean, therefore I need your help. My Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.0'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.2'
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '4.1.0'
end
group :production do
gem 'pg', '0.12.2'
gem 'rails_12factor'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
If you need another project files, please, just tell me about it and Ill do it. Thanks in advance!
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
I'm installing a gem called Carrier https://github.com/stanislaw/carrier/blob/master/Gemfile into a Rails 3.2.1 app. It uses Kaminari and when I did bundle install after adding gem "carrier" to my Gemfile, it showed that I was using kaminari
Using kaminari (0.13.0)
However, when I tried to rake db:migrate, I got this error
rake aborted
undefined method `paginates_per' for Carrier::Chain(Table doesn't exist):Class
Can anyone suggest a fix for this? I've copied the gemfile from the Carrier gem below and the Gemfile for my own app below that
(Carrier gem Gemfile)
source "http://rubygems.org"
gem 'require_all'
gem 'kaminari'
gem 'unread'
gem 'sugar-high'
gem 'sweetloader'
group :development, :test do
gem 'rails', '~> 3.1.0'
gem 'unicorn'
gem 'mysql2'
gem 'devise'
gem 'rake-kit'
gem 'cutter'
gem "jeweler", ">= 1.6.4"
gem "rspec-rails", '>= 2.5'
end
group :test do
gem 'capybara'
gem 'factory_girl'
gem 'spork'
gem "launchy"
gem 'shoulda'
end
Gemfile for my starter app
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise'
gem 'carrier'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
Update These are the migrations it installed when I ran install:migrations
rake carrier:install:migrations
Copied migration 20120229055640_create_messages.carrier.rb from carrier
Copied migration 20120229055641_create_chains.carrier.rb from carrier
Update
I tried to reinstall it again on another git branch it this time I got a slightly different error when I ran rake db:migrate
rake aborted!
undefined method `acts_as_readable' for Carrier::Message(Table doesn't exist):Class
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
You appear to be missing some database backing for what Carrier is trying to do. From the Carrier readme, it looks like you need to run rake carrier:install:migrations before running db:migrate. Have you done that?