Undefined method `best_in_place' on production server - ruby-on-rails-3

I started using the best_in_place gem. It worked fine in my local development machine, but when I deployed the code to the production server, I get:
ActionView::Template::Error (undefined method `best_in_place' for #<#<Class:0xc088ef8>:0xba694a0>):
76: <% t.each do |ticket| %>
77: <tr>
78: <td><%= check_box_tag "tickets[ids][]", ticket.id, false, :class => "status_change" %></td>
79: <td><%= best_in_place ticket, :position, {:inner_class => "input-mini", :type => :input} %></td>
80: <td><%= ticket.id %></td>
81: <td><%= ticket.job_number %></td>
82: <td><%= link_to ticket.name, edit_ticket_path(ticket) %></td>
app/views/tickets/index.html.erb:79:in `block (3 levels) in _app_views_tickets_index_html_erb___947812068_98658810'
app/views/tickets/index.html.erb:76:in `block (2 levels) in _app_views_tickets_index_html_erb___947812068_98658810'
app/views/tickets/index.html.erb:56:in `each'
app/views/tickets/index.html.erb:56:in `block in _app_views_tickets_index_html_erb___947812068_98658810'
app/views/tickets/index.html.erb:50:in `_app_views_tickets_index_html_erb___947812068_98658810'
app/controllers/tickets_controller.rb:11:in `index'
It's as if the gem is not installed. I did make sure I did a bundle install.
View:
<td><%= best_in_place ticket, :position, {:inner_class => "input-mini", :type => :input} %></td>
Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3'
end
# 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', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :production do
gem "mysql", "~>2.8.1"
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 app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
gem 'devise'
gem 'best_in_place'
gem 'paper_trail'
gem 'ckeditor_rails'
gem 'bootstrap-sass'
gem 'bootstrap-datepicker-rails'
gem 'carrierwave'
gem 'ransack'
gem 'nested_form'
gem 'will_paginate'
gem 'capistrano'
gem 'therubyracer'

I ended up having to reboot the server and restart passenger standalone. After this, best_in_place worked. I'm not sure why this is the case, but if anyone is willing to expand on what might have been happening, I will change the correct answer to their solution.

Related

rake aborted cannot load such file --v8 windows

please help, this is my gemfile. It's an old project i created on ubuntu 12.04, now i'm trying to run it on windows 8.
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise', '2.2.4'
gem 'execjs', :git => 'git://github.com/kennyj/execjs.git', :branch => 'rails_issue_2880'
# 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', :platforms => :ruby
gem 'twitter-bootstrap-rails'
gem 'less-rails'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
The command prompt:
C:\Users\manu\Documents\projets\rails\xibart>rake db:migrate
[WARNING] Please install gem 'therubyracer' to use Less.
rake aborted!
cannot load such file -- v8
C:/Users/manu/Documents/projets/rails/xibart/config/application.rb:7:in `<top (r
equired)>'
C:/Users/manu/Documents/projets/rails/xibart/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Uncomment the ruby racer line to install it:
gem 'therubyracer', :platforms => :ruby

500 internal server error on server, works locally

How do I go about tracking down an error when all production.log gives me is this?
11: <%= javascript_include_tag "application" %>
12: <%= csrf_meta_tags %>
13: <%= yield(:head) %>
app/views/layouts/application.html.erb:10:in `_app_views_layouts_application_html_erb__4417234491726047977_45250520'
app/controllers/docs_controller.rb:27:in `index'
Processing by ErrorsController#broken as HTML
Rendered errors/broken.html.erb within layouts/application (0.5ms)
Completed 500 Internal Server Error in 16ms
FYI: the line 10 of application.html.erb is <%= stylesheet_link_tag "application", :media => "all" %> so I'm assuming it has something to do with either my CSS or my gemfile. How do I investigate it further?
Also, my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'json', '1.7.7'
gem 'mysql2'
group :assets do
gem 'coffee-rails'
end
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
end
group :development, :test do
gem 'rspec-rails'
gem 'steak'
gem 'factory_girl_rails'
end
gem 'sass'
gem 'less-rails'
gem 'less-rails-bootstrap'
gem 'jquery-rails'
gem 'devise', '>= 2.1.2'
gem 'cancan'
gem 'paperclip', '~> 3.0'
gem 'therubyracer'
gem 'yaml_db'
gem 'passenger'
gem 'capistrano'
gem 'prawn'
gem 'bootstrap-wysihtml5-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'kaminari'
gem 'truncate_html'
gem 'rails3-jquery-autocomplete'
gem 'whenever'
gem 'impressionist'
gem 'acts_as_list'
gem 'acts_as_indexed'
gem 'state_machine'
gem 'exception_notification'
gem 'public_activity'
My gemfile needed uglifier, which was imported with an old version of another gem.
gem 'uglifier'
fixed it.

Could not update rails

When I do bundle update rails, I get this error:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
rails (= 3.2.11) x86-mingw32 depends on
activesupport (= 3.2.11) x86-mingw32
activesupport (3.1.0)
here is my gemFile, any help is apprecaited :)
source 'http://rubygems.org'
gem 'rails' , '3.2.11'
gem "heroku"
gem 'thin'
gem 'devise'#, '1.5.2'
gem 'will_paginate', '~> 3.0.2'
#gem 'nested_form', :git => 'git://github.com/fxposter/nested_form.git'
gem "simple_form"
gem "cancan"
gem 'kaminari'
gem 'foreigner'
gem "cocoon"
gem 'client_side_validations'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem "jquery-rails"
gem "validate_url", "~> 0.2.0"
gem 'pg', :group => [:production]
gem 'haml'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test, :development do
gem 'sqlite3'
gem 'turn', :require => false
gem "rspec-rails", "2.7"
#gem "rspec"
gem "spork", "> 0.9.0.rc"
gem 'guard-spork'
#gem "webrat", "~> 0.7.3"
gem 'rb-fsevent' # Not mandatory for guard to work, which is why it's not a dependency, but it is an optimization
#gem "guard-spork"
#gem 'minitest'
gem "factory_girl_rails", "~> 1.2"
#gem "webrat-rspec-rails"
gem "mocha"
gem 'capybara' #, :git => 'git://github.com/jnicklas/capybara.git'
gem 'database_cleaner'
gem 'launchy'
gem "capybara-webkit"
#gem 'rspec-multi-mock', :git => 'git://github.com/endeepak/rspec-multi-mock.git'
end
group :test do
#gem 'ruby-debug19', :require => 'ruby-debug'
end
gem 'execjs'
gem 'therubyracer'
First of all you have to delete Gemfile.lock
then update Gemfile to include rails 3.2.11
go to project directory
run bundle install
This may solve your problem

Rails 3 Coffee Handler Missing

Im using Ruby 1.9.3p0, Rails 3.1.2 with Apache and Passenger in Production. When I try to make a remote function, it throws me this error:
ActionView::MissingTemplate (Missing template video/loadVideo, application/loadVideo with
{:handlers=>[:erb, :builder], :formats=>[:js, "application/ecmascript", "application/x-
ecmascript", :html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml,
:multipart_form, :url_encoded_form, :json], :locale=>[:en, :en]}. Searched in
As you can see, there is no handler for :coffee, that's the reason why is not processing the file video/loadVideo.js.coffee; I run the command rake assets:precompile but nothing changes.
The Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'will_paginate', '~> 3.0'
gem "bcrypt-ruby", :require => "bcrypt"
gem 'mysql'
#Problems in Debian, the error was:
#Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs #for a list of available runtimes. (ExecJS::RuntimeUnavailable)
#Solution: http://stackoverflow.com/questions/6282307/rails-3-1-execjs-and-could-not-find-a-javascript-runtime
gem 'execjs'
gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5.rc.2'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', '0.8.2', :require => false
end
Change your Gemfile (move coffee-rails gem outside the assets group) or change your application.rb settings - for instance
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
In development environment application by default loads all of gems from :default, :development, :test, :assets groups. Coffee handler comes from coffee-rails gem, so you have to load it.

Could not find generator refinerycms

I am trying to integrate refinerycms into an existing application. Here is my gemfile
source 'http://rubygems.org'
gem 'rails', '~> 3.1.0.rc8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'mysql2'
gem "arel"
gem 'pdfkit'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier'
end
gem 'jquery-rails'
gem 'aws-s3', :require => 'aws/s3'
gem 'stomp'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
gem 'cucumber-rails'
gem 'database_cleaner'
gem 'factory_girl'
end
gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git'
gem 'refinerycms-generators', :git => 'git://github.com/resolve/refinerycms-generators.git'
gem 'seo_meta', :git => 'git://github.com/parndt/seo_meta.git'
# gem 'refinerycms-i18n', '~> 2.0.0', :git => 'git://github.com/resolve/refinerycms-i18n.git'
gem 'devise', '~>1.4.0'
I am following this tutorial: http://refinerycms.com/guides/attaching-refinery-cms-to-an-existing-rails-application
When I get to the rails generate refinerycms part, I receive the following error: Could not find generator refinerycms.
Any ideas on why this is happening?
Env:
rvm 1.6.30
ruby 1.9.2p180
Rails 3.1.0.rc8
The answer is to run the following command:
rails g refinery:cms