sudo apt-get install ruby1.8-dev
sudo gem install passenger
sudo passenger-install-apache2-module
Manually: configure a vhost in /etc/apache2/sites-available
and link it to /etc/apache2/sites-enabled
with something like the following
^
NameVirtualHost *:80
<VirtualHost *:80>
ServerName application.local
DocumentRoot /opt/application/public
RailsEnv development
RailsAllowModRewrite off
</VirtualHost>
<VirtualH...
You probably pressed Ctrl-S
which stops the buffer. Try Ctrl-Q
to resume.
Try typing this, followed by pressing the return key:
reset
That should clear the screen and reset output settings etc.
This is about converting Haml to ERB and not the other way round which you probably want!
This process can not be automated 100%, but you can still save time.
First do
script/plugin install http://github.com/cgoddard/haml2erb.git
Then in the console type
hamls = Dir["app/views/**/*.haml"] - ['app/views/layouts/screen.html.haml'];
hamls.each do |haml|
puts haml
erb = haml.sub(/\.haml$/, '.erb')
File.open(erb, 'w') do |file|
file.write Haml2Erb.convert(File.read(haml))
end
end
After th...
.notice,
.error,
.information,
.warning {
font-weight: bold;
}
.notice {
color: #11bb00;
}
.error {
color: #F53A31;
}
.information {
color: #557;
}
.warning {
color: #d07d2d;
}
This starts delayed_job, hiding all the output and hiding the process in the background.
rake jobs:work &>/dev/null &
sudo gem install zip
git clone git://github.com/rtomayko/date-performance.git
cd date-performance
rake package:build
cd dist
sudo gem install --no-ri --no-rdoc date-performance-0.4.7.gem
ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => "#{Location.solr_configuration[:type_field]}:#{ModelClass}"))
ActsAsSolr::Post.execute(Solr::Request::Commit.new)
Solr listens to different ports for different environments.
Start Solr (and hide useless output)
rake solr:start PORT=8981 &>/dev/null
rake solr:start PORT=8982 &>/dev/null
Stop Solr
rake solr:stop PORT=8981
rake solr:stop PORT=8982
script/cucumber features/feature_name.feature
Or, if you don't care about speed, you can use rake:
rake features FEATURE=features/feature_name.feature
To improve installation times of gems you can use the following approach:
gem install xyz --no-document
To permanently ignore ri
and rdoc
when installing gems, add this line to ~/.gemrc
:
gem: --no-document
Be aware that eliding local documentation may disable documentation support in your IDE.
To call a class method (or static method) from an instance method:
class.method()
To call a class method from a class method:
method()
This can happen during development when classes without automatic reloading are pointing to classes with automatic reloading. E.g. some class in lib
is calling Model.static_method
.
Stop referencing autoloaded classes from static files. If you can't, see workaround B and C.
Make sure the offending file (the one referencing the autoloaded class) is autoloaded, too. You may do this:
# config/application.rb
config.paths.add 'offending/file/parent/directory', eager_load: true
sudo gem install rails --version="=1.2.3"
rails _1.2.3_ new-project-folder
sudo apt-get install unzip
rake rails:freeze:edge RELEASE=2.2.2
Append this to your ~/.bashrc
:
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \[\033[01;34m\]$\[\033[00m\] '
Reload the changes by saying
source ~/.bashrc
For some customized prompts that also show the current Git prompt, see the examples section at the bottom of our bash prompt customizing card.
To run a single test file:
rake test:units TEST=test/unit/post_test.rb
rake test:functionals TEST=test/functional/posts_controller_test.rb
rake test:integration TEST=test/integration/admin_news_posts_test.rb
You may even run a single test method:
ruby -I test test/unit/post_test.rb -n "name of the test"
ruby -I test test/functional/posts_controller_test.rb -n test_name_of_the_test # underscored, prefixed with 'test_'
Or all tests matching a regular expression:
ruby -I test test/integration/admin_news_posts_test.r...
log/*
tmp/*
storage/*
db/*.sqlite3
db/schema.rb
db/structure.sql
public/system
.project
.idea/
public/javascripts/all*
public/stylesheets/all*
public/stylesheets/*.css
config/database.yml
*~
*#*
.#*
.DS_Store
webrat-*.html
capybara-*.html
rerun.txt
coverage.data
coverage/*
dump_for_download.dump
.~lock.*
.*.swp
C:\\nppdf32Log\\debuglog.txt
If you would like to checkout the branch groups
, you can simply say this in recent versions of Git:
git fetch origin
git checkout groups
This will automatically track origin/groups
from a local branch groups
.
In older Git versions you need to say this:
git fetch origin
git checkout --track origin/groups
This is for people recovering from Subversion.
git clone git@example.com:repositoryname
git status
git commit -m "good description"
git push
git pull
git add file
git add .
git checkout -b branchname
...
In Ubuntu your ALT key is locked when you're working in VirtualBox. There are two workarounds for this:
You are getting when connecting via SSH or deploying with Capistrano (which uses SSH):
Too many authentication failures for username
This is caused by having too many SSH keys added to your keyring or ssh-agent. Your ssh-agent will throw all keys against a server until one matches. Most servers will deny access after 5 attempts.
This issue might come and go as the order of the active SSH keys in your ssh-agent changes.
Have less keys. Up to 5 keys are fine when the SSHD you're connecting to is using the default ...