ノータイトル RSS

Archive

May
25th
Fri
permalink
25 down vote accepted You have broken version of RVM - Ubuntu does something to RVM that produces lots of errors, the only safe way of fixing for now is to: sudo apt-get —purge remove ruby-rvm sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh open new terminal and validate environment is clean from old rvm settings (should be no output): env | grep rvm if there was output, try to open new terminal, if it does not help - restart computer install RVM: curl -L get.rvm.io | bash -s stable —auto do not forget to read rvm requirements before installing rubies

ubuntu - Installed Ruby 1.9.3 with RVM but command line doesn’t show ruby -v - Stack Overflow

これを見ながらRVMをインストール完了。apt-getで一回試した俺が馬鹿だったよ・・・。

May
24th
Thu
permalink
permalink
If you have a problem connecting, run the commands below and restart Ubuntu, then try again. echo “gnome-session —session=ubuntu-2d” > ~/.xsession

Connect to Ubuntu 12.04 (Precise Pangolin) via Windows Remote Desktop | Liberian Geek

この通りのコマンドを入れて再起動したら繋がるようになった。感激。これで快適なUbuntu Lifeが

permalink
Define Indexes in a Class Method, Invoke in Initializer A small tweak to putting indexes into an initializer was to place the knowledge of the indexes back into the model classes themselves. Then, all you needed to do was invoke the model class method to create it’s own indexes. The Initializer Code ? 1 2 3 4 5 # Rails.root/config/initializers/mongo_config.rb Event.create_indexes Encounter.create_indexes Setting.create_indexes The Model(s) Code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class Setting include MongoMapper::Document # Attributes :::::::::::::::::::::::::::::::::::::::::::::::::::::: # What the user sees as a label key :label, String # How we reference it in code key :identifier, String, :required => true … # Indexes ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: def self.create_indexes self.ensure_index(:identifier, :unique => true) self.ensure_index(:label, :unique => true) end … end

Configuring MongoMapper Indexes in Rails App » Technical Debt

インデックスはこんなコードで、実装しよう。

permalink
permalink
May
23rd
Wed
permalink
permalink
May
22nd
Tue
permalink
May
20th
Sun
permalink