<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nuclear Rooster &#187; Joyent Accelerator</title>
	<atom:link href="http://dev.nuclearrooster.com/category/joyent-accelerator/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.nuclearrooster.com</link>
	<description></description>
	<lastBuildDate>Mon, 19 Jul 2010 03:48:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Errno::EACCES permissions error using paperclip with JRuby on Joyent</title>
		<link>http://dev.nuclearrooster.com/2009/03/03/errnoeacces-permissions-error-using-paperclip/</link>
		<comments>http://dev.nuclearrooster.com/2009/03/03/errnoeacces-permissions-error-using-paperclip/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 20:32:41 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Joyent Accelerator]]></category>
		<category><![CDATA[Ruby/Rails]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[joyent]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=85</guid>
		<description><![CDATA[We ran into a permission error using the 'paperclip' plugin. It had something to do with moving a tmp file into the rails public directory. The odd thing was that it could create the appropriate directories in the rails public directory, but it couldn't copy the file. Digging around the web, I found this group [...]]]></description>
			<content:encoded><![CDATA[<p>We ran into a permission error using the 'paperclip' plugin.  It had something to do with moving a tmp file into the rails public directory.  The odd thing was that it could create the appropriate directories in the rails public directory, but it couldn't copy the file.</p>
<p>Digging around the web, I found this group about this exact problem. </p>
<p>http://groups.google.com/group/paperclip-plugin/browse_thread/thread/4a0a97a08929d3a5</p>
<p> I found that I had all of the patches, but it still didn't work.  Most of the people on the group were complaining it that it didn't work on Windows, and maybe had something to do with file handles, etc.  We were trying to get this working in JRuby on a Joyent Solaris Accelerator, each of which can make things a little different than a MRI Rails app on Linux.</p>
<p>Following a tip from a user on the group, simply changing the way the move happens fixes this problem.  I would like to fix the root cause, but I got it working for me, and (*open source sigh*) don't want to isolate the exact problem.</p>
<blockquote><p>
After that, i made some change in storage.rb#flush_writes.<br />
It's a short workaround for</p>
<pre class="brush: ruby;">
  FileUtils.mv
</pre>
<p>Simply replace it with</p>
<pre class="brush: ruby;">
  FileUtils.cp(file.path, path(style))
  FileUtils.rm(file.path)
</pre>
<p>Currently, it works for me. But please consider, it isn't checked against a well written test or any other platform.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2009/03/03/errnoeacces-permissions-error-using-paperclip/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Broken SVN Post Commit on Joyent Accelerator</title>
		<link>http://dev.nuclearrooster.com/2008/04/14/broken-svn-post-commit-on-joyent-accelerator/</link>
		<comments>http://dev.nuclearrooster.com/2008/04/14/broken-svn-post-commit-on-joyent-accelerator/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 17:22:17 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Joyent Accelerator]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=36</guid>
		<description><![CDATA[I was trying to remove and add lots of files (unfreezing/freezing Rails 2.0), and subversion was just being a pain. It would go through all of the motions for committing, including actually committing the code, but then it would error and leave my working copy all confused. ........ Adding vendor/rails/actionpack/test/template/tag_helper_test.rb Adding vendor/rails/actionpack/test/template/text_helper_test.rb Adding vendor/rails/actionpack/test/template/url_helper_test.rb Adding [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to remove and add lots of files (unfreezing/freezing Rails 2.0), and subversion was just being a pain.  It would go through all of the motions for committing, including actually committing the code, but then it would error and leave my working copy all confused.</p>
<pre>
........
Adding         vendor/rails/actionpack/test/template/tag_helper_test.rb
Adding         vendor/rails/actionpack/test/template/text_helper_test.rb
Adding         vendor/rails/actionpack/test/template/url_helper_test.rb
Adding         vendor/rails/actionpack/test/testing_sandbox.rb
Transmitting file data ............................................................................................................................................................................................................................................................................................................svn: Commit failed (details follow):
svn: MERGE request failed on '/svn/source/Geartracks/trunk/vendor/rails'
svn: MERGE of '/svn/source/Geartracks/trunk/vendor/rails': 200 OK (http://svn.nickstielau.com)
</pre>
<p>I googled around for a little and found a <a href="http://ubergeek.tv/article.php?pid=136">helpful article</a> on Ubergeek.  They found that a failing post-commit hook script would cause this error.  And then I remembered, checking something on my Joyent Accelerator Webmin panel when I was creating the svn repository.  </p>
<p><a href='http://dev.nuclearrooster.com/wp-content/uploads/2008/04/picture-2.png'><img style="border: 2px dashed #CCCCCC" src="http://dev.nuclearrooster.com/wp-content/uploads/2008/04/picture-2.png" alt="This is where I turned on the post-commit, which broke my checkins" title="Joyent Accelerator Webmin" class="aligncenter size-medium wp-image-37" /></a></p>
<p>I looked around a little and found the post-commit hook that webmin created for me:</p>
<pre>
[nickstielau:~] admin$ sudo cat /home/svn.nickstielau.com/svn/source/hooks/post-commit
Password:
#!/bin/sh
EMAIL="my_email@gmail.com"
REPOS="$1"
REV="$2"
/opt/webmin-1.340/virtualmin-svn/commit-email.pl --from my_email@gmail.com -s "SubVersion commit" "$REPOS" "$REV" "$EMAIL"
</pre>
<p>No problems there.  Looking at the perl script, we find a configuration section:</p>
<pre class="brush: perl;">
######################################################################
# Configuration section.

# Sendmail path, or SMTP server address.
# You should define exactly one of these two configuration variables,
# leaving the other commented out, to select which method of sending
# email should be used.
# Using --stdout on the command line overrides both.
#$sendmail = &quot;/usr/sbin/sendmail&quot;;
$smtp_server = &quot;127.0.0.1&quot;;

# Svnlook path.
my $svnlook = &quot;/usr/bin/svnlook&quot;;

# By default, when a file is deleted from the repository, svnlook diff
# prints the entire contents of the file.  If you want to save space
# in the log and email messages by not printing the file, then set
# $no_diff_deleted to 1.
my $no_diff_deleted = 0;
# By default, when a file is added to the repository, svnlook diff
# prints the entire contents of the file.  If you want to save space
# in the log and email messages by not printing the file, then set
# $no_diff_added to 1.
my $no_diff_added = 0;

# End of Configuration section.
######################################################################
</pre>
<p>I wasn't sure if I had an SMTP server running locally, but I could easily check sendmail.</p>
<pre>
[nickstielau:~] admin$ which sendmail
sendmail is /opt/csw/sbin/sendmail
[nickstielau:~] admin$ which svnlook
svnlook is /opt/csw/bin/svnlook
</pre>
<p>So I commented the SMTP line and put the the appropiate paths to <code>svnlook</code> and <code>sendmail</code>.</p>
<pre>
$sendmail = "/opt/csw/sbin/sendmail";
#$smtp_server = "127.0.0.1";

# Svnlook path.
my $svnlook = "/opt/csw/bin/svnlook";
</pre>
<p>Booyeah.  Emails on commits.  Also notice the two configuration settings there, <code>no_diff_deleted</code> and <code>no_diff_added</code>, to configure how detailed the commit emails are.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2008/04/14/broken-svn-post-commit-on-joyent-accelerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
