天道酬勤,学无止境

ruby-1.9.3

Installing RVM/Ruby 1.9.3 via Chef

问题 我刚刚开始尝试将我的基础架构转移到 Chef,我想我一定遗漏了一些明显的东西。 我正在使用 chef-rvm 食谱安装 RVM,我希望它安装 Ruby 1.9.3p125 并将其设置为默认值。 这是我的基本服务器角色: name "base" description "Basic configuration for all nodes" run_list( 'recipe[git]', 'recipe[sudo]', 'recipe[ubuntu]', 'recipe[rvm]', 'recipe[postgresql::client]' ) override_attributes( :authorization => { :sudo => { :users => ["ubuntu"], :passwordless => true } }, :rvm => { :rubies => ["ruby-1.9.3-p125"], :default_ruby => "ruby-1.9.3-p125", :global_gems => ['bundler', 'rake'] } ) 这运行没有任何问题,但如果我在完成后 ssh 进入服务器,rvm 不会列出任何已安装的 rubies: ubuntu@test.server:~$ rvm list rvm rubies # No rvm

2022-05-06 07:55:14    分类:技术分享    amazon-web-services   amazon-ec2   chef-infra   ruby-1.9.3

Passing Multiple Parameters in a form_tag

问题 我正在使用 Rails 和 jqPlot 在网页上显示一些数据。 图表需要按日期灵活(例如,用户可以选择时间范围,图表会自行更新)。 到目前为止,这是我的代码(在我的视图中): <%= form_tag home_event_trends_path(params[:timePeriod]), :method => 'post' do %> <p> <%= select_tag :timePeriod, options_for_select(["2 Hours Ago", "1 Week Ago", "3 Months Ago"], :selected => params[:timePeriod]) %> <%= submit_tag "Refresh", :name => nil %> </p> <% end %> Home是我的控制器,我想event_trends是一个动作。 (路径为 localhost:3000/home/event_trends.3102030) 这工作正常。 但是,我还需要将另一个参数传递给我的控制器。 这个网页已经有一个参数传递给它, params[:format] (这是 URL 中的 3102030,它会根据我要显示的事件而变化),我也需要传递这个参数。 我试过了: home_event_trends_path(params[

2022-05-04 00:08:25    分类:技术分享    html   ruby-on-rails   forms   ruby-on-rails-3.2   ruby-1.9.3

Installing RVM/Ruby 1.9.3 via Chef

I'm just getting started with trying to move my infrastructure over to Chef, and I think I must be missing something obvious. I'm using the chef-rvm cookbook to install RVM, and I'd like it to install Ruby 1.9.3p125 and set that as the default. Here's my base server role: name "base" description "Basic configuration for all nodes" run_list( 'recipe[git]', 'recipe[sudo]', 'recipe[ubuntu]', 'recipe[rvm]', 'recipe[postgresql::client]' ) override_attributes( :authorization => { :sudo => { :users => ["ubuntu"], :passwordless => true } }, :rvm => { :rubies => ["ruby-1.9.3-p125"], :default_ruby =>

2022-04-30 02:12:32    分类:问答    amazon-web-services   amazon-ec2   chef-infra   ruby-1.9.3

Passing Multiple Parameters in a form_tag

I'm using Rails and jqPlot to display some data on a webpage. The graph needs to be flexible by date (as in, the user can select a time range, and the graph will update itself). Here's my code so far (in my View): <%= form_tag home_event_trends_path(params[:timePeriod]), :method => 'post' do %> <p> <%= select_tag :timePeriod, options_for_select(["2 Hours Ago", "1 Week Ago", "3 Months Ago"], :selected => params[:timePeriod]) %> <%= submit_tag "Refresh", :name => nil %> </p> <% end %> Home is my controller, event_trends is an action, I suppose. (The path is localhost:3000/home/event_trends

2022-04-28 17:51:14    分类:问答    html   ruby-on-rails   forms   ruby-on-rails-3.2   ruby-1.9.3

安装 Ruby 1.9.3 时出错(Error while installing Ruby 1.9.3)

问题

2022-04-01 11:57:04    分类:技术分享    ruby   ubuntu   rvm   ruby-1.9.3

bundle install and ruby versions?

I'm using rbenv to set the ruby version. ruby -v produces the expected 1.9.3 I can do gem install paperclip without a problem. However, when I do bundle install it says: Installing paperclip (3.1.2) Gem::InstallError: paperclip requires Ruby version >= 1.9.2. An error occured while installing paperclip (3.1.2), and Bundler cannot continue. Make sure that `gem install paperclip -v '3.1.2'` succeeds before bundling. but, ruby -v says I'm running 1.9.3. Is bundler runnign as sudo? Have anyone addressed this problem?

2022-03-22 03:51:05    分类:问答    paperclip   bundler   ruby-1.9.3   rbenv