I tried using this with an app that has Active Admin. Doesn't want to play nice. Gives the error "undefined method `downcase' for nil:NilClass". When I take out Active Admin, it works fine. Anyone else run into this?
I have a problem, my nginx server is running with nginx user, and when the application try to access the /assets files i have a 403 http error. I changed the nginx user to deployer group but the issue persists. Can you help me to fix this? The only difference between your post and my server is i'm running in a centos distribution.
Hum, just wondering, I don't know nginx much, but as the unicorn socket has the app name in it, shouldn't the upstream be something like unicorn_<%= application %> so that there can be more than one ?
This is my question too!
Does it make sense to invest time to learn another tool, when capistrano seems to be able to make any task on any number of servers?
Wow, this is great. I usually use apache+passenger and a MySQL database. Tried to read up on the differences and benchmarks, but it's still not clear to me: is it just a matter of personal preference or is this setup (postgres, nginx, unicorn) really faster/better?
Great episode but I wasted some valuable time on a silly issue. The omniauth-aouth gem is gobbling the app errors and its pretty difficult to debug them.
In this case,the following needs to be changed in the user model to
Ryan mentioned in the screencast that it used to be a paid service, but since thoughtbot decided to shut it down, they have open sourced it for everyone to use, hence this episode.
So you can still use it, as shown by Ryan, you just have to host it yourself (for better or worse).
Sometimes Chef just seems so heavy. Using Capistrano for provisioning would means one less tool to learn...
What problems does Chef solve that can't be addressed by Ryan's Capistrano approach? I know chef is good for large deployments, but for small/medium sized systems this Capistrano approach seems great.
I followed these directions exactly but when I visit http://[ip] I get "Not Found: /". However, when I visit http://[ip]/[appname] it hits the app. Is it possible one of the paths in one of the configs is wrong?
As kind of an addendum to the link, at the time I wrote that (not too long ago) I saw honestly almost nobody talking about api (json) template building. At least not in my visible sphere.
Things have changed dramatically since then. Now with jbuilder, the revised json_builder, serializers, boxer, et al it seems that this space has gotten a lot of attention recently especially with the rise of Backbone. I consider this a very good thing. I think every api templater that has popped up has a valid use case and an interesting use case. Down with to_json :P
Great episode Ryan. My only question was is there a reason you used rbenv over rvm to install ruby? Has rvm fallen out of favor? Are you using rbenv on OS X?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "et_EE.UTF-8",
LANG = "et_EE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
could not change directory to "/root"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
If your cap deploy is failing, and you're logging into your server to troubleshoot manually, when you ssh to the server, if Agent forwarding is not already configured by default on your local machine, you'll need to enable it so you can communicate with github:
I seem to be having issues, I am getting
Error: Parse error on line 2: Unexpected 'INDENT'
...raffler/app/assets/templates/entries/index.jst.eco)
I literally cut and paste the code in. Using rails 3.2.2, coffee-rails 3.2.2 I must say I am beginning to despair if it takes 4+ hours to get Hello World working with a railscast that is less than 30 days old
Raffler
<% for entry in @entries.models: %>
<%= entry.get('name') %>
<% end %>
I seem to be having issues, I am getting
Error: Parse error on line 2: Unexpected 'INDENT'
...raffler/app/assets/templates/entries/index.jst.eco)
I literally cut and paste the code in. Using rails 3.2.2, coffee-rails 3.2.2 I must say I am beginning to despair if it takes 4+ hours to get Hello World working with a railscast that is less than 30 days old
Raffler
<% for entry in @entries.models: %>
<%= entry.get('name') %>
<% end %>
This screencast is brilliant -- much needed by many (obviously, from the comments!), and good to have out there.
I am a big fan of running the app as a special user, rather than root, so glad to see that.
It's also funny -- I love the occasional remarks like "this probably won't work the first time" for Capistrano. Understatement is the best form of humor ;-)
Finally a vote for a fantastic VPS host I have used since 2006 -- RimuHosting has great prices, many options, and best of all, really competent people to help when things go wrong.
Luis Pablo or anybody else:
Could you please post some example code in more detail. I´m new to Rails and don´t get it working. Don´t know in which controller to write the join and so on :-(
Maybe someone can post the exact steps for jayeshmori´s example with the video and category?
How to sort days in calendar table such as <%= calendar.head('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')%> with correct order of day? I want to make Monday the first day of the week.
please help me!
Thanks for this ryan, amazing as always!
I used this with Kaminari along with using a script to see if the pagination links are in the window view area (since I was working with a table that is in the middle of the page)
Coffee Script below:
I used @pages.current_page < @pages.num_pages since I couldn't get the @pages.next? method working with collections. Hopefully it will work in a future release.
Anyone experienced an issue when running rvmsudo, that the script hangs at a password prompt that can not be entered?
ruby
Lets say this task:
task :export, :roles => :appdo
run "cd #{release_path} && rvmsudo bundle exec foreman export upstart"end
Then rvmsudo will hang at [sudo] password for, you wont be able to enter a password.
I solved this issue by executing a random sudo command in front of the rvmsudo command.. For example sudo "whoami". But i wonder if there is a clean solution.
Also anyone experienced an issue that they can not restart their services trough rvmsudo? For example rvmsudo restart #{application}" throws /usr/bin/env: restart: No such file or directory
There is a simple fix for this: Just use a pinging service that pings the site every minute or so. I do this with new relic. And voila, your app doesn't fall asleep anymore.
Significantly so.
I tried using this with an app that has Active Admin. Doesn't want to play nice. Gives the error "undefined method `downcase' for nil:NilClass". When I take out Active Admin, it works fine. Anyone else run into this?
I correct this issue changing the permission of public/assets folder to this --> chmod o+rx, now works fine.
I have a problem, my nginx server is running with nginx user, and when the application try to access the /assets files i have a 403 http error. I changed the nginx user to deployer group but the issue persists. Can you help me to fix this? The only difference between your post and my server is i'm running in a centos distribution.
Where does it store the data? Does it override internationalization files?
Hum, just wondering, I don't know nginx much, but as the unicorn socket has the app name in it, shouldn't the upstream be something like unicorn_<%= application %> so that there can be more than one ?
It is being actively maintained by two former clients of Thoughtbot that heavily use Copycopter going forward.
There are some plans to make it a mountable engine.
gem 'thin' should be in Gemfile for this to work:
rackup private_pub.ru -s thin
This is my question too!
Does it make sense to invest time to learn another tool, when capistrano seems to be able to make any task on any number of servers?
Wow, this is great. I usually use apache+passenger and a MySQL database. Tried to read up on the differences and benchmarks, but it's still not clear to me: is it just a matter of personal preference or is this setup (postgres, nginx, unicorn) really faster/better?
Any plan to convert this into a mountable engine? I still found it a hassle that it has to make a call for each page request.
Great episode but I wasted some valuable time on a silly issue. The omniauth-aouth gem is gobbling the app errors and its pretty difficult to debug them.
In this case,the following needs to be changed in the user model to
instead of
Hey Ryan - it would truly be AWESOME if you could include your Linode server setup script and share it over there!
Ryan mentioned in the screencast that it used to be a paid service, but since thoughtbot decided to shut it down, they have open sourced it for everyone to use, hence this episode.
So you can still use it, as shown by Ryan, you just have to host it yourself (for better or worse).
I would recommend reading the post over at the thoughtbot blog as well.
As a side note, if copycopter isn't enough for you, Locale is also worth checking out.
Does this link mean anything? Says they are shutting it down.
Great screencast as always.
However you should not check configuration, especially secrets, into code.
Sometimes Chef just seems so heavy. Using Capistrano for provisioning would means one less tool to learn...
What problems does Chef solve that can't be addressed by Ryan's Capistrano approach? I know chef is good for large deployments, but for small/medium sized systems this Capistrano approach seems great.
Looks like the client has decent caching, and co-processes that keep it up-to-date. Cool!
Well, turns out the rackup file was tampered with! :-/
Ryan,
I followed these directions exactly but when I visit http://[ip] I get "Not Found: /". However, when I visit http://[ip]/[appname] it hits the app. Is it possible one of the paths in one of the configs is wrong?
Can you try again with RABL 0.6.4 if you get a chance and followup?
As kind of an addendum to the link, at the time I wrote that (not too long ago) I saw honestly almost nobody talking about api (json) template building. At least not in my visible sphere.
Things have changed dramatically since then. Now with jbuilder, the revised json_builder, serializers, boxer, et al it seems that this space has gotten a lot of attention recently especially with the rise of Backbone. I consider this a very good thing. I think every api templater that has popped up has a valid use case and an interesting use case. Down with to_json :P
Yes personally using RABL with Backbone (or Spine) and also with https://github.com/gazay/gon has made for a great combination for my projects. Anyone reading this might find https://github.com/nesquena/rabl/wiki/Backbone-Integration and https://github.com/nesquena/rabl/wiki/Flexible-Responses useful as well.
Great episode Ryan. My only question was is there a reason you used rbenv over rvm to install ruby? Has rvm fallen out of favor? Are you using rbenv on OS X?
Is there a way to display just the checkbox instead of a word ?
Just a bit of configuration to do and it will be okay: http://www.flynsarmy.com/2011/04/fixing-perl-locale-errors-in-a-clean-ubuntu-install/
Does anyone have a good css snippet for vertical-aligning the label in the middle of a text area?
running postgresql fails. see error
Having the exact same issue... did you resolve this?
Troubleshooting tip:
If your cap deploy is failing, and you're logging into your server to troubleshoot manually, when you ssh to the server, if Agent forwarding is not already configured by default on your local machine, you'll need to enable it so you can communicate with github:
instead of:
ssh deployer@your-server.com
use:
ssh -A deployer@your-server.com
would love to see this updated for Rails 3 with asset pipeline and coffeescript. Or what's the current recommendation for js unit testing with rails?
Which log have you looked at? You probably want to check your unicorn/production logs
Shhh... that's a dev secret :P
One answer: pull
unicorn_init.sh
out of source control and put it in the#{shared_path}/config/
directory and symlink to it likedatabase.yml
.Another odd thing, the generated application.js seemed to be escaping the '/' with '//' I had to manually fix that. HTH someone.
I seem to be having issues, I am getting
Error: Parse error on line 2: Unexpected 'INDENT'
...raffler/app/assets/templates/entries/index.jst.eco)
I literally cut and paste the code in. Using rails 3.2.2, coffee-rails 3.2.2 I must say I am beginning to despair if it takes 4+ hours to get Hello World working with a railscast that is less than 30 days old
Raffler
<% for entry in @entries.models: %>
<%= entry.get('name') %>
<% end %>
I seem to be having issues, I am getting
Error: Parse error on line 2: Unexpected 'INDENT'
...raffler/app/assets/templates/entries/index.jst.eco)
I literally cut and paste the code in. Using rails 3.2.2, coffee-rails 3.2.2 I must say I am beginning to despair if it takes 4+ hours to get Hello World working with a railscast that is less than 30 days old
Raffler
<% for entry in @entries.models: %>
<%= entry.get('name') %>
<% end %>
How would you deploy to multiple stage environments with your unicorn configuration? Specifically, how to you change:
to
when you run
cap staging deploy
orcap production deploy
, respectively?I'd also like to add my support for a follow up episode that covers cancellations, insufficient funds etc
I completely agree with you. This breaks MVC and should not be used. A pity, since I like the idea -- just not the execution.
This screencast is brilliant -- much needed by many (obviously, from the comments!), and good to have out there.
I am a big fan of running the app as a special user, rather than root, so glad to see that.
It's also funny -- I love the occasional remarks like "this probably won't work the first time" for Capistrano. Understatement is the best form of humor ;-)
Finally a vote for a fantastic VPS host I have used since 2006 -- RimuHosting has great prices, many options, and best of all, really competent people to help when things go wrong.
Figured out a way from your recent post on Capistrano using Multistage-extension. thnx for that one.
I found solution, it's simply:
....
<% calendar_for @articles, :year => @date.year, :month => @date.month, :first_day_of_week => 1 do |calendar| %>
...
thanks to all
Luis Pablo or anybody else:
Could you please post some example code in more detail. I´m new to Rails and don´t get it working. Don´t know in which controller to write the join and so on :-(
Maybe someone can post the exact steps for jayeshmori´s example with the video and category?
Hope someone can help!
How to sort days in calendar table such as <%= calendar.head('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')%> with correct order of day? I want to make Monday the first day of the week.
please help me!
Thanks for this ryan, amazing as always!
I used this with Kaminari along with using a script to see if the pagination links are in the window view area (since I was working with a table that is in the middle of the page)
Coffee Script below:
And in the index.js.erb file:
I used
@pages.current_page < @pages.num_pages
since I couldn't get the@pages.next?
method working with collections. Hopefully it will work in a future release.Anyone experienced an issue when running rvmsudo, that the script hangs at a password prompt that can not be entered?
Then rvmsudo will hang at
[sudo] password for
, you wont be able to enter a password.I solved this issue by executing a random sudo command in front of the rvmsudo command.. For example
sudo "whoami"
. But i wonder if there is a clean solution.Also anyone experienced an issue that they can not restart their services trough rvmsudo? For example
rvmsudo restart #{application}"
throws /usr/bin/env: restart: No such file or directoryThere is a simple fix for this: Just use a pinging service that pings the site every minute or so. I do this with new relic. And voila, your app doesn't fall asleep anymore.
Yes you can overwrite the find_one method. Look at https://github.com/norman/friendly_id/issues/197 for an example.
But make sure that you are starting with the right finder method, eg history uses another one.