remote-style not showing on my GitHub Pages portfolio - github-pages

The Problem
I wanted to install a remote theme for my portfolio website, but I am not exactly sure why it isn't working. Either I installed the remote-theme incorrectly in the only two files I edited, Gemfile and _config.yml, or it is going wrong whenever I enter bundle install/bundle update.
If you have any suggestions, please let me know!
Thanks!
I added "." at the beginning of each line of my Gemfile and _config.yml because it thought I was trying to use headings. As well as spacing each line out.
What I've Tried
In the Gemfile and config file, When I comment out the default "minima" theme, and only include the "hacker" theme, I expected it to update the theme of my GitHub pages website when I pushed to the GitHub repo.
Also, when I enter the command "bundle install" or "bundle update" in the terminal, I get an error:
Could not find gem 'http_parser.rb (= 0.8.0)' with platform 'x86_64-darwin-21' in rubygems repository
https://rubygems.org/ or installed locally.
The source contains the following gems matching 'http_parser.rb (= 0.8.0)':
http_parser.rb-0.8.0
So I installed http_parser.rb 0.8.0 I expected it to install all of these gems smoothly.
to show what I have done in each file, here is my _config.yml:
.`title: My Portfolio
.email:
.description: >- # this means to ignore newlines until "baseurl:"
.Welcome to my page! Here you will find an accumulation of completed projects
.from Frontend Mentor,
.as well as a few of my own unique projects.
.baseurl: "" # the subpath of your site, e.g. /blog
.url: "" # the base hostname & protocol for your site, e.g. http://example.com
.twitter_username: jekyllrb
.github_username: jekyll
.# Build settings
.# theme: minima
.remote_theme: pages-themes/hacker#v0.2.0
.plugins:
.jekyll-feed
.jekyll-remote-theme`
.and here is the part of the Gemfile that involves installing remote-themes:
`.# Happy Jekylling!
.# gem "jekyll", "~> 4.3.1"
.gem "github-pages", "~> 227", group: :jekyll_plugins
.gem "jekyll-include-cache", group: :jekyll_plugins
.gem "jekyll-remote-theme"
.# This is the default theme for new Jekyll sites. You may change this to .anything you like.
.# gem "minima", "~> 2.5"
.# gem "hacker", "~> 0.2"
.# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
.# uncomment the line below. To upgrade, run bundle update github-pages.
.# gem "github-pages", group: :jekyll_plugins
.# If you have any plugins, put them here!
.group :jekyll_plugins do
. gem "jekyll-feed", "~> 0.12"
.end`

Related

Error installing backlogs plugin in Redmine

I have the following problem. I am trying to install the "redmine_backlogs" version 1.0.6 plugin in an environment with Redmine 3.2.0 with a Ruby 2.0.0 version
The problem gives me when I download the plugin, I host it in the plugin directory of my redmine installation, and when following the documentation, I issue the command bundle exec rake db: migrate gives me the following error:
[!] There was an error parsing `Gemfile`:
[!] There was an error parsing `Gemfile`: You cannot specify the same gem twice with different version requirements.
You specified: capybara (> = 0) and capybara (~> 1.1.0). Bundler cannot continue.
 # from / var / www / redmine / plugins / redmine_backlogs / Gemfile: 51
 # -------------------------------------------
 # unless chiliproject
 > gem "capybara", "~> 1.1.0"
 # gem "poltergeist", "~> 0.6.0"
 # -------------------------------------------
. Bundler cannot continue.
 # from / var / www / redmine / Gemfile: 110
 # -------------------------------------------
 # Dir.glob File.expand_path ("../ plugins / * / {Gemfile, PluginGemfile}", __FILE__) do | file |
 > eval_gemfile file
 # end
 # -------------------------------------------
I can't find a way to solve it so that it is properly installed.
Any extra help?
Thank you very much in advance.
Your plugin has a Gemfile in it's root directory, which has an entry for the capybara gem.
Bundler now complains because either Redmine, or another Plugin, have an entry for the same library in their Gemfile, but with a conflicting version requirement.
As Capybara is only used for running tests, it should be safe to just remove that line from the backlog plugin's Gemfile.

Rails generate not working on a existing application

I cloned a rails project from github and trying to run rails generate rspec:install after running bundle install. The console gives following
`Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/sankethpurwar/.rvm/rubies/ruby-2.3.1/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
-B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle install
-G, [--skip-git], [--no-skip-git] # Skip .gitignore file
[--skip-keeps], [--no-skip-keeps] # Skip source control .keep files
-O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files
-S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library
# Default: jquery
-J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files
[--dev], [--no-dev] # Setup the application with Gemfile pointing to your Rails checkout
[--edge], [--no-edge] # Setup the application with Gemfile pointing to Rails repository
-T, [--skip-test-unit], [--no-skip-test-unit] # Skip Test::Unit files
[--rc=RC] # Path to file containing extra configuration options for rails command
[--no-rc], [--no-no-rc] # Skip loading of extra configuration options from .railsrc file
Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend], [--no-pretend] # Run but do not make any changes
-q, [--quiet], [--no-quiet] # Suppress status output
-s, [--skip], [--no-skip] # Skip files that already exist
Rails options:
-h, [--help], [--no-help] # Show this help message and quit
-v, [--version], [--no-version] # Show Rails version number and quit
Description:
The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
Example:
rails new ~/Code/Ruby/weblog
This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.`
Do I need to do any additional setup to work with an existing code base?
I think you are not running generator command from project directory. go to your project directory then run the command. If bundler in not installed then run gem install bundler after that run bundle install

Is there a way to prevent rails to precompile assets on production?

I have a lot of assets in my project. The precompile task in the server is very slow and exhaust the host (CPU utilization 100%, high average latency).
My idea is to precompile all assets in my localhost and send to GIT (master) all files already precompiled.
In the deploy action (cap production deploy), avoid the precompile task and in the server, prevent any precompile task.
The server uses the already precompiled files sended via capistrano, available in GIT.
Is it possible? If yes, how to do?
If no, there's another solution to avoid server precomile assets?
Below my configs:
Gemfile
gem 'capistrano-rails', group: :development
gem 'capistrano-faster-assets', '~> 1.0', group: :development
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/faster_assets'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
config/environments/production.rb
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
config.assets.compile = true
config.assets.digest = true
other assets configs in this file is commented
Environment info
OS: Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64)
ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
rails -v: 4.2.3
nginx -v: nginx/1.8.0
passenger -v: 5.0.10
If you need more information, tell me on the comments.
Short answer:
Replace
require 'capistrano/rails'
with
require 'capistrano/rails/migrations'
require 'capistrano/bundler'
Why this works:
When you require capistrano/rails, you are really including the following (source):
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Each of these can be included separately to get just those pieces of functionality. Per the docs: https://github.com/capistrano/rails#usage

Rails 4.2 Rails.application.config.assets.version doesn't invalidate digest asset file names

I have a Rails 4.2.4 (Ruby 2.2.2) application and I am serving static assets via Cloudfront.
If Cloudfront is serving something you don't want, there are two possibilities:
Invalidate the content in Cloudfront or
Change the name of the asset served
However, when i change
Rails.application.config.assets.version = '1.0'
to
Rails.application.config.assets.version = '2.0'
(in config/initializers/assets.rb)
and
delete all the assets in public/assets
run "RAILS_ENV=staging bundle exec rake assets:precompile"
the same file names are generated!
The only way i found to invalidate the digested file of application.scss was to add some dummy content in order to provoke a new md5 checksum.
What am i doing wrong?
Shouldn't a new assets.version change the digested file names?
Best Regards and thanx!
As per the comments in the Rails pull request I opened, this is a regression that needs to be fixed: https://github.com/rails/sprockets-rails/issues/240
Update: As sansarp mentions, one of the workarounds listed in that github issue is to use an old version of sprockets:
gem 'sprockets', '< 3.0.0'
Another workaround is to use the asset path as a cache breaker instead:
# config/initializers/assets.rb
Rails.application.config.assets.prefix = "/assets/v1"
Using sprockets of previous version could help you to get file names as expected. gem 'sprockets', '< 3.0.0' https://github.com/rails/sprockets
If you use capistrano for deployment be sure to set assets_prefix in the deploy.rb file.
set :assets_prefix, "assets/v1"

Spree with Payupaisa Gateway

I want to add Payupaisa gateway for my shopping cart site. I use spree. I used gem
gem 'spree_payupaisa', :github => "meetdestiny/spree_payupaisa_express", :branch => "2-1-stable"
https://github.com/meetdestiny/spree_payupaisa_express
but it give error while I am updating bundle
Git error: command `git rev-parse 2-1-stable` in directory
/home/tps/.rvm/gems/ruby-2.0.0-p247#demo/cache/bundler/git/spree_payupaisa_express-6aebc199a8cbc824377ffe9416c892e73cc3271e has failed.
Thank in Advance.
The instructions on that repository are incorrect. That git repository doesn't have a 2-1-stable branch. Try the following in your Gemfile:
gem 'spree_payupaisa', :github => "meetdestiny/spree_payupaisa_express"
Which should currently work with Spree 2.1.
You should file an issue/pull request on the repository to correct the instructions.