RailsCasts Pro episodes are now free!

Learn more or hide this

Tyler DeWitt's Profile

GitHub User: workmaster2n

Comments by Tyler DeWitt

Avatar

I just got this working. I had to adjust the variable localhost to my server's ip address in both the application.html.erb (layout) file and the application.js file.

Avatar

Not sure if you are still having an issue, but jerclark solved this (search this page for "mobile" instead of "iPhone". I missed it for a month):

I resolved it by changing the server property in config/private_pub.yml from "localhost" to my dev server IP address.

You'll need to change it to something that your mobile device can access. Also, if you manually included the private_pub javascript using a javascript_include_tag with an absolute URL to localhost, you'll probably want to change it there as well.

I had to restart the app to make this work.

Avatar

@tatumszymczak Were you able to get this working? I've got the same problem. Thinking it may be related to mobile browsers

Avatar

Just in case anyone misreads this as I did, "I've found the after_touch method a good place to clear the cache as well" as in I found I need to use both after_commit and after_touch.

Great find on the after_touch callback!

after_commit doesn't get called if you are just touching the record, ie have nested caches that get invalidated through touching.

Avatar

I'm using haml and had to change the call to calendar to be of the display format (I had to do = calendar do |date| instead of - calendar do |date|). Is this expected? Ryan had the call to calendar marked as nondisplaying code, but had it the other way initially.

Avatar

I'm trying to use Passenger and have now twice hosed my install.

I can successfully complete this line of the script in the show notes

ruby
# rbenv
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
vim .bashrc # add rbenv to the top
. .bashrc
rbenv bootstrap-ubuntu-10-04
rbenv install 1.9.3-p125
rbenv global 1.9.3-p125
gem install bundler --no-ri --no-rdoc
rbenv rehash

But when I go to run

passenger
# Phusion Passenger (instead of Unicorn)
sudo apt-get -y install libcurl4-openssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev
sudo gem install passenger --no-ri --no-rdoc
sudo passenger-install-apache2-module
sudo vim /etc/apache2/apache2.conf # modify as instructed by installer

I get a sudo: gem: command not found error.

If I exit the deployer session and su deployer from root, I get this error: /home/deployer/.rbenv/bin/rbenv: line 20: cd: /root: Permission denied

Then running ruby -v gives me this error bash: ruby: command not found when previously that worked for deployer.

Any ideas what I'm doing wrong?