I am learning Compass with Django/Zinnia. Running the following to produce css produces an error that I don't really understand. Thanks!
cd /var/www/static/zinnia
compass compile ./ --trace
LoadError on line ["36"] of /usr/lib/ruby/1.9.1/rubygems/custom_require.rb: cannot load such file -- susy
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `require'
/var/www/static/zinnia/./config.rb:2:in `get_binding'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:24:in `eval'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:24:in `parse_string'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `block in _parse'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `block in new_from_file'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/commands/project_base.rb:25:in `configure!'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/commands/update_project.rb:37:in `initialize'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
/var/lib/gems/1.9.1/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/var/lib/gems/1.9.1/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>'
/var/lib/gems/1.9.1/gems/compass-0.12.2/bin/compass:44:in `call'
/var/lib/gems/1.9.1/gems/compass-0.12.2/bin/compass:44:in `<top (required)>'
/usr/local/bin/compass:23:in `load'
/usr/local/bin/compass:23:in `<main>'
Compass was not installed. I issued the following per cimmanon's suggestions:
gem install compass
gem install compass-susy-plugin
gem install stitch
via http://data.agaric.com/installing-compass-and-sass-susy-ubuntu
Also had to install java for compass-validate to work.
Related
while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.
I changed my distro from Ubuntu to Elementary OS. I kept my /home directory, so that I don't have to install anything.
I followed GoRail's guide to install Rails.
Now when I try to re-install everything from the same guide, it turns out that RVM, Ruby and Rails are already there.
➜ sample_app git:(master) ✗ rails -v
Rails 4.2.2
However, when I go to my old projects and try to start a server it throws the following error:
➜ sample_app git:(master) ✗ rails s
/home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/config/application.rb:7:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
➜ sample_app git:(master) ✗
As per your error message
There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
It seems you don't have NodeJS installed. Run
sudo apt-get install nodejs
bundle install
See "There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)".
I'm a complete noob in ruby, so please pardon my mistakes.
I'm installing Apphera (a social networking crawler) on Ubuntu 14.04, and I'm getting this error when I'm trying to start the ruby server
ankit#APPSERVER:/home/deployer/apphera$ rails s
/usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:61:in `rescue in lock': uninitialized constant V8::JSError (NameError)
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:19:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `instance'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/loader.rb:10:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>'
from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `block in require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler.rb:134:in `require'
from /home/deployer/apphera/config/application.rb:16:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I understand that this issue that got something to do with the JS environment on the system and I tried installing nodes, but the error was same. I tried almost every solution mentioned on SO, but nothing worked for me.
Here are some specific details about my installation:
Ruby : 1.9.1
gem - v : 2.4.5
gem list | grep libv8 --> libv8 3.16.14.7
gem list | grep therubyracer --> therubyracer 0.12.1
I tried installing therubyracer/libv8 both manually and with with bundle install, but it didn't work. I even made changes to my gemfile/Gemfile.lock, but,again, nothing worked.
A few days ago I updated my gems because things weren't running so fine, so I went back to 1.4.2. Since then I'm getting all kind of weird errors.
I'm using Ruby 2.0.0p247, Rails 4.0 and Ubuntu.
If I try to start a new app using rails new eraseme, everything goes fine until it's time to do bundle install. The output is:
run bundle install
/usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `require': cannot load such file -- bundler (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `bundle_command'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:277:in `run_bundle'
from (eval):1:in `run_bundle'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/application.rb:43:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/cli.rb:15:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/cli.rb:15:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/bin/rails:9:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
If I try to open the console, I get:
>> bundle exec rails console
Loading development environment (Rails 4.0.0)
/usr/local/lib/ruby/2.0.0/irb/locale.rb:150:in `block in search_file': undefined method `try_activate' for Gem:Module (NoMethodError)
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:158:in `block in each_localized_path'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:167:in `each_sublocale'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:157:in `each_localized_path'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:145:in `search_file'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:124:in `find'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:108:in `load'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:32:in `initialize'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:114:in `new'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:114:in `init_config'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:16:in `setup'
from /usr/local/lib/ruby/2.0.0/irb.rb:380:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Have you already installed bundler? If not, try:
gem install bundler
If so, try:
gem install bundler --pre
If you running Ruby version manager, what version are you running? You might be set to the wrong version of Ruby.
I think it would be easier for you if you used RVM or some other version manager.
if you have multiple versions of rubygems installed, uninstall all but the one you want to use.
I think rails 4 requires rubygems 2.x.
Also check the bundler version.
I finally got the gem pg to install. Now when I go to migrate the database I get the following:
$ rake db:migrate
(in c:/rubyDev/bsbaslic)
rake aborted!
no such file to load -- 1.9/pg_ext
c:/Ruby192/lib/ruby/gems/1.9.1/gems/pg-0.10.0/lib/pg.rb:10:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/pg-0.10.0/lib/pg.rb:10:in `<top (required)>'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:112:in `require'
c:/rubyDev/bsbaslic/config/application.rb:7:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
c:/rubyDev/bsbaslic/Rakefile:4:in `<top (required)>'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `load'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:1991:in `run'
c:/Ruby192/bin/rake:31:in `<main>'
Does anybody have any ideas as to what it is looking for? I have a pg_ext.so file in the same directory as pg.rb.
Windows programs cannot load .so files - they load .dll files instead. You need a build of pg compiled for Windows, or you need to be running Ruby from within a Linuxy environment such as msys or cygwin.
The problem is in your version of pg gem. There is a special version for windows pg 0.9.0.
In order to have it workingon windows:
uninstall the current pg 0.10.0
install pg as follows: gem install pg --version=0.9.0 -- --with-pg-config=/short/path/to/postresql/bin
(To get short path you can simply change directory to PostgrSQL bin and then type command in cmd, it will automaticaly change path to a short verison)
Then edit your project Gemfile in order to use correct pg gem version (0.9.0)
And that's it.
Good Luck