Gem使用常见问题

03 May 2013, by

rake

将下面一行添加到.bashrc 就ok了
export RUBYOPT="-U -Ku -E utf-8:utf-8"

更新
source ~/.bashrc

simple-form

<%= f.input :is_private, as: :select, label: false, include_blank: false, priority: ["public", "仅团队成员可见"], collection: [["仅团队成员可见", "true"], ["公开可见", "false"]], label_html: { class: "select optional" } %>

whenever

sphinx

全文搜索Sunspot 出现 RSolr::Error::Http - 500 Internal Server Error 解决方法:

log:

RSolr::Error::Http - 500 Internal Server Error
Error: Severe errors in solr configuration.

Check your log files for more detailed information on what may be wrong.

If you want solr to continue after configuration errors, change:

<abortOnConfigurationError>false</abortOnConfigurationError>

in null

The solution:

Sunspot

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

bundle exec rake sunspot:solr:start
brew tap caskroom/cask
brew install brew-cask
brew cask install java

使用rvm安装gem出现权限错误

解决方法:chown -R free ~/.rvm,然后再安装,sudo gem install sqlite3。

gem libv8 install 出错

therubyracer installation on windows with libv8 installed –with-system-v8
gem install libv8 -v 3.16.14.3 -- --with-system-v8

rails s 出错

rails s

An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.