snowedin.net
域名年龄: 22年5个月26天HTTP/1.1 200 OK 访问时间:2013年10月21日 23:50:29 服务器:Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Pingback: http://erikonrails.snowedin.net/xmlrpc.php Keep-Alive: timeout=5, max=100 连接:Keep-Alive Transfer-Encoding: chunked 类型:text/html; charset=UTF-8 网站编码:UTF-8
Erik on RailsOne developer’s experiences learning Ruby on RailsScript for opening the latest migrationApril 17th, 2013Often after generating a Rails migration I want to edit it, but it’s annoying to have to type in those dang timestamps. So I wrote a little script that just opens the newest one:#!/bin/shs db/migrate/`ls db/migrate | tail -n 1`Put that in ~/bin/latest-migration, chmod u+x it, and add ~/bin to your PATH and you can just run latest-migration from within any Rails folder. Of course you have to replace ’s’ with the command for invoking your text editor of choice.Tags: bash, migrations, rails Posted in Uncategorized | 1 Comment »env: ruby_bundler_wrapper: No such file or directorySeptember 20th, 2012I spent bunch of time scratching my head, trying to figure out why my ruby executables (rails, heroku, etc) weren’t working. I thought it was because I had an old custom shebang in my .gemrc, but that didn’t seem to change anything. I ran gem regenerate binstubs and that didn’t help either. I still to this day don’t even know what package provides ruby_bundler_wrapper, or even where it lives.BUT, I figured out the problem for me was that I had my gems stored in a global rvm gemset, so I had to regenerate the binstubs in there:rvm @global do rvm regenerate binstubsAnd that seemed to do the trick. Long morning of system administration today.Tags: bash, bundler, ruby, rvm Posted in Uncategorized | 2 Comments »“libxml2 is missing” error when installing Nokogiri gem on Mac OS X LionSeptember 4th, 2012I’m not 100% sure what did the trick for me, but the last thing I did was symlink my gcc binary to gcc-4.2, which for some reason is hardcoded in Nokogiri:sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2As suggested here. The Nokogiri gem is totally unhelpful with the error messages. It just tells you that libxml2 can’t be found, no matter what the build problem is. If you are having trouble getting Nokogiri to install, your friend is the mkmf.log. On an RVM sytem, that’ll be in ~/.rvm/gems/[your gemset]/gems/nokogiri-1.5.5/ext/nokogiri/mkmf.log. Without RVM it’ll be wherever gem sticks unbuilt gems by default.Posted in Uncategorized | No Comments »Quoting quotes in RubyJune 21st, 2012Cucumber makes heavy use of quotes to wrap data:When I purchase "Oryx and Crake"Then I should receive an email with the subject "Thank you for your purchase!"I sometimes need to to programmatically generate these strings, when invoking steps-within-steps:When /^I purchase "([^""]*)"$/ do |title|step "Search for \"#{title}\""...endThankfully, Ruby has a metric shit ton of ways to quote strings. But what I haven’t seen mention of is the fact that you can just use the % operator with an arbitrary character to get a fully interpolated string:# These are all equivalent:step %~Search for "#{title}"~step %
© 2010 - 2020 网站综合信息查询 同IP网站查询 相关类似网站查询 网站备案查询网站地图 最新查询 最近更新 优秀网站 热门网站 全部网站 同IP查询 备案查询
2025-05-28 19:52, Process in 0.0063 second.