UTF8 error in shapado installation - shapado

Hi I did the installation until “rake bootstrap RAILS_ENV=development” line. After that I get this error
WARNING: Sinatra 1.2.x has reached its EOL. Please upgrade. rake aborted! (eval):1: invalid multibyte char (UTF-8) (eval):1: invalid multibyte char (UTF-8) (eval):1: syntax error, unexpected end-of-input /[a-zA-Z][a-zA-Z0-9_-�-�]{0,24}/
^
/home/canercak/.bundler/ruby/2.0.0/mongoidext-ea4337c5aebe/lib/mongoidext.rb:8:in '
/home/canercak/dev/shapado/config/application.rb:16:in‘ /home/canercak/dev/shapado/Rakefile:4:in `’ (See full trace by running task with —trace)
I have ubuntu 13 runnig in US-EN settings. I used magic_encoding to add “# –– encoding : utf-8 ––” on top of every file but still get the error.
Any help would be greatly appreciated

I've sorted it out by changing rvm version to 1.9ç.3 and reinstalling the app

Related

"make rails" giving syntax errors in terminal

Every time I run "make rails" I get syntax errors and warnings within my terminal.
I'm using ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin18.0] because the project I'm working on mandates it, but I can update if needed.
We are currently using a legacy rails site as one of the users in the comments pointed out. This led to the find that we are our project would need to be run on ruby 2.3.0 as SOLR doesn't support the newer versions in our project. Furthermore, running bundle install also helps to resolve dependencies of older projects.
This is what I get when I make rails:
Ahans-MacBook-Pro:app ahansabharwal$ make rails
POSTGRES starting
pg_ctl -D ./db/development.pg -l ./db/development.pg/postgres.log start
waiting for server to start.... done
server started
Connection to localhost port 5432 [tcp/postgresql] succeeded!
SOLR starting
bundle exec rake sunspot:solr:start
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2097: warning: else without rescue is useless
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2103: warning: else without rescue is useless
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2142: warning: else without rescue is useless
rake aborted!
SyntaxError: /Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2093: syntax error, unexpected modifier_if
if separator.value == 'auto'
^
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2097: syntax error, unexpected ',', expecting keyword_end
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2103: syntax error, unexpected ')', expecting keyword_end
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2138: syntax error, unexpected modifier_if
if separator.value == 'auto'
^
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2142: syntax error, unexpected ')', expecting keyword_end
/Users/ahansabharwal/.rvm/gems/ruby-2.1.3#project/gems/sass-3.7.2/lib/sass/script/functions.rb:2920: syntax error, unexpected keyword_end, expecting end-of-input
.
. (similar syntax errors)
.
(See full trace by running task with --trace)
make[1]: *** [solr-force-start] Error 1
make: *** [solr] Error 2
Solved this issue by installing ruby 2.3.0, older versions aren't supported by SOLR. (2.6.0 onwards is not currently supported in our project)

Cannot generate any migrations for Rails 4.2, Ruby 2.1.4. Syntax error in bin/rails

Whenever I try to create a migration, I get the following error. Does anyone know what could be causing this?
$ rails generate migration NewMigration
/Users/myuser/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `eval': /Users/myuser/.rvm/gems/ruby-2.1.4/bin/rails:19: syntax error, unexpected '=', expecting keyword_end (SyntaxError) /Users/myuser/.rvm/gems/ruby 2.1.4/bin/rails:23: syntax error, unexpected end-of-input, expecting keyword_end
from /Users/myuser/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `<main>'
Somehow your bin/rails file got modified. Run gem pristine -a in the same rvm you were using before. This rebuilds / reinstalls all your gem files.

Unable to install SproutCore

I used
rvm 1.8.7 do gem install sproutcore
It was installed successfully, but now on running sproutcore gen project getting_started
it gives me the following errors:
/Users/user/.rvm/gems/ruby-1.8.7-p370/gems/sproutcore-1.8.2.1/vendor/chance/lib/chance/instance/slicing.rb:22: syntax error, unexpected ':', expecting '}'
mtime: file[:mtime],
^
/Users/user/.rvm/gems/ruby-1.8.7-p370/gems/sproutcore-1.8.2.1/vendor/chance/lib/chance/instance/slicing.rb:23: syntax error, unexpected ':', expecting '='
canvas: canvas
^
/Users/user/.rvm/gems/ruby-1.8.7-p370/gems/sproutcore-1.8.2.1/vendor/chance/lib/chance/instance/slicing.rb:234: syntax error, unexpected $end, expecting kEND
I think this is a "known bug" with Ruby 1.8.7 as it's using some syntax that is only available in 1.9.
You should probably try upgrading to Ruby 1.9.2 or 1.9.3 which should fix the issue.
I agree with Topher Fangio, but to add how: this is what I did.
gem update --system

output_safety.rb:34 warning: regexp match /.../n against to UTF-8 string

When starting up my WEBrick server, I get next warning when calling the home page:
c:/Program Files/jruby-1.6.7/lib/ruby/gems/1.8/gems/activesupport-
3.2.2.rc1/lib/active_support/core_ext/string/output_safety.rb:34
warning: regexp match /.../n against to UTF-8 string
Can someone tell me why I'm getting this warning?
+
I'm running JRuby in 1.9 mode, but here I'm getting an error from a gem in 1.8 folder. Why is that? Shouldn't the gems from the 1.9 folder be used?
this issue is discussed here github.com/rails/rails/issues/3927

Rails, Passenger, Encoding::CompatibilityError in spawn manager

Ruby 1.9.2
Rails 3.0.9
ssl_requirement 1.3.2
passenger 3.0.8
After updating ssl_requirement, when deploying the app I'm now getting Encoding::CompatibilityError in spawn manager exceptions
The more details trace indicates that ssl_requirement is involved, during loading of required gems on startup:
ssl_requirement.gemspec:11: invalid multibyte char (US-ASCII)
/home/bill/.bundler/ruby/1.9.1/ssl_requirement-0db844a72f88/bartt-ssl_requirement.gemspec:11: invalid multibyte char (US-ASCII)
/home/bill/.bundler/ruby/1.9.1/ssl_requirement-0db844a72f88/bartt-ssl_requirement.gemspec:11: syntax error, unexpected $end, expecting ']'
...}, %q{bartt}, %q{Thorben Schröder}]
... ^) (process 29902, thread #<Thread:0x00000001274858>):
I added the magic encoding tags everywhere in the app, per several google search results, and all my initializers, etc have the proper declarations for UTF-8, but can't make the 500 error go away. What else should I do? Thanks
Solved this by backing ssl_requirement back down to 1.3.1, then monkey patching in the changes I needed from 1.3.2. Problem solved for now, although I'd like to implement a real solution that doesn't include patching the prior version.

Resources